Vermin configuration file
See original GitHub issueMany tools support loading configuration from config files in addition to command line arguments (e.g. flake8, mypy, pytest). It would be good if vermin can also do this. In some sense, declaring project configuration in a config file is more clear and discoverable than saving command line arguments in a script or Makefile, and is much better than typing out the command line arguments manually in the long term.
Proposed config file name and format
- Many tools have chosen the INI format, and put all configuration items in one specific section. For
verminthe file name could bevermin.iniand the section name could bevermin. - Tools tend to look for multiple files to find configuration (e.g.
toolname.ini,setup.cfg,tox.iniand such). This allows a project to put configuration for different tools in different sections in a single file likesetup.cfg. Forvermin, it is a good start to only look atvermin.ini, and this may be extended in the future. - Tools may look for a config file in the “containing directory” of processed files and the parent directories. For
vermin, to simplify, it is a good start to only look at the current working directory (assuming users are runningverminin project root), and this may be extended in the future.
Here is a sample vermin.ini:
[vermin]
# declaring minimum compatible version in a config file is good
target = 3.4
# key names in the INI file can be the same as the "long form" argument name in CLI
exclude = foo.bar.baz
backport = argparse,typing
# alternative way to express arrays:
backport =
argparse
typing
# this is supported by flake8 and pytest, not sure how INI format handles arrays
feature = fstring-self-doc
Configuration priority
- When using CLI, manually passed command line arguments override the items in the config file
- When using the Python API, we may have two options:
- Don’t read the config file at all
- Manually passed config objects override the items in the config file (Does it make sense to look for a config file in the current working directory? We’re passing code strings and not dealing with any files.)
Finally, it could be good to print a verbose message like “loading configuration from file …” when a configuration file is discovered and used. This will let users know that a config file is in effect and help them diagnose configuration problems.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (17 by maintainers)
Top Results From Across the Web
netromdk/vermin: Concurrently detect the minimum ... - GitHub
Configuration File. Vermin automatically tries to detect a config file, starting in the current working directory where it is run, following parent folders ......
Read more >Vermin Hunter - PCGamingWiki PCGW
↑ File/folder structure within this directory reflects the path(s) listed for Windows and/or Steam game data (use Wine regedit to access ...
Read more >Using vermin to manage your own VMs - Mohammed Hewedy
You need to configure the VM so we can run ansible-playbook against it to make it vermin-ready. Obtain the IP address of the...
Read more >Vermin
Vermin is a smart, simple and powerful command line tool for Linux, Windows and macOS. It's designed for developers who want a fresh...
Read more >How to use the vermin.main function in vermin - Snyk
To help you get started, we've selected a few vermin.main examples, based on popular ways it is used in public projects.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Looks good
Oh for the
--exclude-fileparameter, I’ve misunderstood its meaning. I thought it is excluding certain files from analysis rather than reading--excludeargs from a file (instead of from CLI). Excluding certain files from analysis could be useful to some extent, if a project has some files with.pyextension which are test cases (data) for static analysis rather than code to be executed.As for
vermin.inidetection in subfolders, I thinks it’s fine not to check all subfolders based on file paths specified insys.argv. The user can easily specify the config file in the subfolder via--config-file, or simply do achdirbefore executingvermin. And it’s fine to only recognize one config file instead of allowing multiple config files (and the one in the subfolder overrides the one in the root folder). Otherwise the design would be complicated.