jendrikseipp / vulture

Find dead Python code
MIT License
3.42k stars 150 forks source link

Support reading options from setup.cfg #210

Closed psidex closed 4 years ago

psidex commented 4 years ago

From looking at multiple python tools (flake8, mypy, pytest, to name a few), the setup.cfg file seems to be one of the most widely supported for saving configurations.

The Python standard library contains configparser, so there is no need for any dependencies.

I imagine something like this:

[vulture]
exclude=*settings.py,docs/
ignore-names=foo*,ba[rz]
min-confidence=100

Or maybe [tool:vulture] instead?

And running it like this:

vulture --config-file ./setup.cfg ./myscript.py

I'm happy to attempt to implement it myself and create a pull request if you want me to 😄

jendrikseipp commented 4 years ago

We are already discussing adding support for pyproject.toml in #164. It seems pyproject.toml is the way forward for new tools, so I'd rather not add support for setup.cfg. A pull request for pyproject.toml support would be welcome :-)