-
-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default config file name #318
Comments
|
Having said that, I am not strongly opposed to using a recommended default of |
i think such behavior was present in an earlyer version. why was that changed? |
I have no recollection of there ever been a default, its always been None as far as I remember: Line 174 in 094a2d4
|
there is no default defined yet: PyCQA/bandit#318 use the openstack default for now
There is a section in readme file which suggests using a https://github.com/PyCQA/bandit/blob/master/README.rst#per-project-command-line-args
This sounds like |
I find it tremendously useful when a tool has a well known default config filename, since I can quickly see if project is using a particular tool, and what proves even more useful: search thru github repositories by filename (e.g. |
ok, if someone can make a patch making But it's imperative we keep the |
Please do not try to combine or change the naming. If anything, the documentation should be made more clear as evident by the comments in this issue. |
Whats is wrong with combining the two in single yml? as you can see it is confusing for the users (myself included) and trying to fix that with additional documentation when combining the two seems to be
What are the drawbacks that I'm not seeing that out weight the benefits? |
I'd prefer to see a Also, the options available in a configuration file need to be fully documented, ideally also printed by the CLI |
@ericwb, can you explain what "distant future" is intended to mean? It sounds a bit like this request is meant to die slowly. Personally, I'd prefer to see:
|
Was there ever a PR that implemented this? As of 8127716, looks like no:
And yet the README instructs:
To use what? Make a |
Bump. As of this writing, documentation does not say the config file must be explicitly set via |
Also jumping in here: What is the default name for YAML style supposed to be?
We are planning to place this file in a few dozens of repos – for now forcedly with Therefore, big +1 for #318 (comment) Any (official) comment is highly appreciated! Cheers, lcnittl |
Trying out a few things, looks like the current behaviour is:
But the docs say Would be good to use |
According to the source code there are two different files in play:
Both the docs and the docstrings in the source code are in parts out of sync with the implementation. This has been criticized with several issues in the past. Information about using the INI-style configuration is mostly found in issues that report problems of use. The docs originally covered only the scanning configuration, and the INI-style configuration was exclusively mentioned in the project README. This has recently been consolidated (#773), but more work needs to be done to make the documentation usable. Anyone who can read code and edit The confusion in the documentation is also reflected in the code. The project comes from sysadmin efforts at OpenStack and could do with some refactoring that makes the code more elegant, straight-forward and easier to understand and maintain. In my eyes, it may also make sense to consolidate the configuration into a single configuration file (the now popular |
@bittner Thank you for digging into that — I had wasted a bit of time on the YAML-formatted Strong +1 for enabling |
@acdha As a side note, if you have a GitLab Ultimate license I recommend using GitLab's SAST integration. Their scanning container that has Bandit on board does a parsing and transformation of Bandit's scan report. Only this way GitLab will correctly recognize the report content. You won't get the details in GitLab's Security dashboard, otherwise. |
@bittner GitLab is the reasons I was looking for a default configuration file and ended up here. I want to disable the |
My workaround: exclude the whole Reference: https://docs.gitlab.com/ee/user/application_security/sast/#vulnerability-filters |
What would help tremendously is if the [bandit]
configfile = pyproject.toml This would solve so many problems at once:
|
Whoever is active in this repository might take a look at my PR which has been sitting waiting for a review for some 9 months :) |
Is your feature request related to a problem? Please describe.
The doc say i should create a YAML config file, but not how to name it. https://bandit.readthedocs.io/en/latest/config.html
Describe the solution you'd like
Please recommend a sane default name, so it is consistent in any project and can be found by CI etc.
I recommend using
.bandit.yml
because it is hidden on Linux, UNIX and macOS and has an extension.Describe alternatives you've considered
I don't see any alternatives. Leaving it as is leads to chaos!
Additional context
Codacy says: "You can also use custom .bandit or bandit.yml config file."
I have also seen
bandit.yaml
in earlier issues.For a sane solution, i look what similar tools do.
Most
.name
for INI-style config or.name.yml
for YAML config.pylintrc
or.pylintrc
: https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options.flake8
.pycodestyle
or config insetup.cfg
ortox.ini
: http://pycodestyle.pycqa.org/en/latest/intro.html#configuration.pydocstyle
,.pydocstyle.ini
,.pydocstylerc
,.pydocstylerc.ini
: http://www.pydocstyle.org/en/2.1.1/usage.html#configuration-files.coveragerc
.travis.yml
,.circleci
,.github
,.appveyor.yml
The text was updated successfully, but these errors were encountered: