Giter Site home page Giter Site logo

codacy-bandit's People

Contributors

cog avatar dependabot-preview[bot] avatar gjsduarte avatar igfcoimbra avatar josemiguelmelo avatar lachmanfrantisek avatar ljmf00 avatar lolgab avatar machadoit avatar mrfyda avatar paulopontesm avatar pedrorijo91 avatar prokopst avatar rtfpessoa avatar stefanvacareanu7 avatar waisbrot avatar xplosunn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codacy-bandit's Issues

[CY-2527] Don't report common patterns used for test development

Codacy reports a few patterns, I would say falsely, that are very commonplace in test development.

Examples

  • "Use of assert detected" – using assert is the main pattern when using pytest
  • "Possible hardcoded password" – making your test simple entails using hardcoded input values and testing the outcome in a hardcoded way again
  • "Starting a process with a partial executable path" – mimicking the natural use of a CLI, for example

Sane Defaults vs. Custom Configuration

The result of Codacy's current defaults is that we have projects where 100% of the reported issues are in the test suite, e.g. https://app.codacy.com/manual/VSHN/concierge-cli/issues/index

I'm aware that Bandit has its own shortcomings (see PyCQA/bandit#603) and the reported issues come directly from the tool. But given the fact that you seem to run a custom approach, you as a code quality platform should probably set the standards here (read: sane, intuitive defaults).

[TS-634] [BUG] `.bandit` file is used as config, should be ini

observed

If .bandit file is found, it is run with bandit -c .bandit. (see above)
This is wrong.

expected

.bandit file is expected to be in INI format and must be run with bandit --ini .bandit.

https://bandit.readthedocs.io/en/latest/config.html#

To use this, put an INI file named .bandit in your project’s directory. [...]

contact

private lazy val nativeConfigFileNames = Set("bandit.yml", ".bandit")

BTW: the bandit.yml is a config, not an INI, and is correctly called with bandit -c bandit.yml

[CY-2528] support more bandit configuration files

It would be great for codacy to support [bandit] section in setup.cfg file and alternatively [tool.bandit] in pyproject.toml file.
The detected configuration files at the moment (.bandit and bandit.yml) are most definitely less often used in repos than the setup.cfg/pyproject.toml variants as they are employed to combine settings for many such static analysis/testing tools.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.