-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support loading options from a configuration file (pyproject.toml?) #164
Comments
Hi @Varriount, Thanks for the feedback, but I'm not sure that I entirely get what you're trying to say. Can you give an example of what exactly are you asking for, please? |
Alternatively, perhaps [tool.vulture]
min-confidence = 70
exclude = ".eggs,.git,.*cache,.tox,.venv,build,dist" This would allow a user to have more determinism in their I recently implemented this in tartufo, based heavily on the work in black. This style of configuration is being adopted in many other large Python tools. A list of other tools can be found here: https://github.com/flying-sheep/awesome-python-packaging In addition, mypy will be adding support as well. |
@tarkatronic sounds interesting! It would be awesome if you could make a pull request. |
@jendrikseipp I can work on this. However, adding support for |
Good point. I'm not sure. Having no external dependencies certainly has appeal. Also, it's not clear which TOML library we should use (there are 3 Python TOML libraries). Maybe we should defer this issue until the dust has settled on how to declare options for linters and similar tools. |
I guess we could make the TOML dependency optional like isort does. Still, it's not clear which TOML library to use. |
https://pypi.org/project/toml/ seems to be the standard and most popular (more than 18k users according to https://github.com/uiri/toml) |
I checked which projects use which toml library:
So it seems "toml" is indeed the way to go. Especially, since we only need to load TOML, not modify it. |
isort now bundles a vendorized copy of toml. We could probably do the same. |
Having some configuration support would be helpful for CI pipelines as well. Until recently I have been in the camp being "against yet another dependency" just for project development support like TOML. But a recent episode on a podcast changed my mind about this... let me find it back... here it is. I would be willing to work on this if you let me know which way you'd like to go. I see either pyproject.toml with a vendored parser or a simple .ini file. I'm not all too opposed to adding a real dependency for a TOML parser instead of vendoring but I am leaning more towards vendoring too. @jendrikseipp let me know if you want me to go ahead with one of those solutions. |
nb, this issue might benefit from a better subject. The primary topic is the be able to have config-values in a config file in addition to the cli-args. Might help others find it a bit better. |
@exhuma thanks for the link! I'll listen to the episode and will get back to you on this. |
@jendrikseipp I will likely start to dabble around with it tomorrow, just to familiarise myself with the project structure of |
@exhuma Sounds great! I listened to the podcast and think that the best solution is to add a dependency on |
will do |
Done. Let me know what you think :) |
Now that #215 has merged, let's close this? |
Good point :-) |
It would be nice if vulture supported using setup.cfg/setup.ini to retrieve whitelists, exclusions, etc. from.
The text was updated successfully, but these errors were encountered: