Skip to content
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

Add config via setup.cfg #736

Open
okainov opened this issue Sep 9, 2021 · 4 comments
Open

Add config via setup.cfg #736

okainov opened this issue Sep 9, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@okainov
Copy link

okainov commented Sep 9, 2021

Is your feature request related to a problem? Please describe.

I'd like to use single setup.cfg file for many different linters/plugins/style checkers. Currently bandit requires to have special config for it and is not able to read setup.cfg.

Describe the solution you'd like

  1. Check multiple different paths for config file by default
  2. Implement proper parsing of setup.cfg (which is not YAML but more like INI-like format)

Example:


[isort]
# https://github.com/timothycrosley/isort/wiki/isort-Settings
line_length=119
case_sensitive=True
multi_line_output=7
force_single_line=True
default_section=THIRDPARTY

[bandit]
# https://bandit.readthedocs.io/en/latest/blacklists/index.html#
tests: ['B603']

[flake8]
# https://flake8.pycqa.org/en/latest/user/configuration.html
show_source = True

per-file-ignores =
    python/pypi/*: WPS300, WPS442

Describe alternatives you've considered
Separating configs which works, but clutters the workspace with files

Additional context
Basically the same as #212 (which was probably closed by mistake)

@okainov okainov added the enhancement New feature or request label Sep 9, 2021
@asears
Copy link
Contributor

asears commented Sep 29, 2021

Would it make more sense to use pyproject.toml for this effort as part of modernization?
See #550 which is awaiting some publish.

@okainov
Copy link
Author

okainov commented Sep 30, 2021

@asears yes and no :) From one side I'm all for supporting different formats, if it makes some folks happy, why not, more is not less. From the other side, in our projects we do use setup.cfg with a lot of different tools and plugins and even if we would like to migrate to something (and we probably are not really into that for now), it wouldn't be so trivial and fast. And so far Bandit is the only tool from our set which doesn't support setup.cfg as-is. So as a user I would love to see this implemented.

@devops-hacks
Copy link

@asears Both my thumbs up go for this feature request - we only use setup.cfg files at present as our code base has NOT been modernized and I don't think it will, because it simply works as it is and we have hundreds of python project only with setup.cfg files...

@ssbarnea
Copy link
Member

Should be refused as won't fix due to PEP-621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants