nitpick.core module
The Nitpick application.
- class nitpick.core.Nitpick[source]
Bases:
object
The Nitpick API.
- configured_files(*partial_names: str) List[Path] [source]
List of files configured in the Nitpick style. Filter only the selected partial names.
- echo(message: str)[source]
Echo a message on the terminal, with the relative path at the beginning.
- enforce_present_absent(*partial_names: str) Iterator[Fuss] [source]
Enforce files that should be present or absent.
- Parameters:
partial_names – Names of the files to enforce configs for.
- Returns:
Fuss generator.
- enforce_style(*partial_names: str, autofix=True) Iterator[Fuss] [source]
Read the merged style and enforce the rules in it.
Get all root keys from the merged style (every key is a filename, except “nitpick”).
For each file name, find the plugin(s) that can handle the file.
- Parameters:
partial_names – Names of the files to enforce configs for.
autofix – Flag to modify files, if the plugin supports it (default: True).
- Returns:
Fuss generator.
- init(project_root: Path | str | None = None, offline: bool | None = None) Nitpick [source]
Initialize attributes of the singleton.