Nitpick uses plugins to handle configuration files.
There are plans to add plugins that handle certain file types, specific files, and user plugins. Check the roadmap.
Below are the currently included plugins.
Enforce configurations and autofix INI files.
.ini files handled by this plugin:
Style examples enforcing values on INI files: flake8 configuration.
Enforce configurations and autofix JSON files.
Add the configurations for the file name you wish to check. Style example: the default config for package.json.
Enforce configuration on text files.
To check if
some.txt file contains the lines
def (in any order):
[["some.txt".contains]] line = "abc" [["some.txt".contains]] line = "def"
Enforce configurations and autofix TOML files.
E.g.: pyproject.toml (PEP 518).
Enforce configurations and autofix YAML files.
The plugin tries to preserve comments in the YAML file by using the
It works for most cases.
If your comment was removed, place them in a different place of the fil and try again.
If it still doesn’t work, please report a bug.
Known issue: lists like
additional_dependencies might be joined in a single line,
and comments between items will be removed.
Move your comments outside these lists, and they should be preserved.
No validation of
.pre-commit-config.yaml will be done anymore in this generic YAML plugin.
Nitpick will not validate hooks and missing keys as it did before; it’s not the purpose of this package.