nitpick package

Main module.

class nitpick.Nitpick[source]

Bases: object

The Nitpick API.

configured_files(*partial_names: str) List[pathlib.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[nitpick.violations.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, fix=True) Iterator[nitpick.violations.Fuss][source]

Read the merged style and enforce the rules in it.

  1. Get all root keys from the merged style (every key is a filename, except “nitpick”).

  2. For each file name, find the plugin(s) that can handle the file.

Parameters
  • partial_names – Names of the files to enforce configs for.

  • fix – Flag to modify files, if the plugin supports it (default: True).

Returns

Fuss generator.

init(project_root: Optional[Union[pathlib.Path, str]] = None, offline: Optional[bool] = None) nitpick.core.Nitpick[source]

Initialize attributes of the singleton.

project: nitpick.project.Project
run(*partial_names: str, fix=False) Iterator[nitpick.violations.Fuss][source]

Run Nitpick.

Parameters
  • partial_names – Names of the files to enforce configs for.

  • fix – Flag to modify files, if the plugin supports it (default: True).

Returns

Fuss generator.

classmethod singleton() nitpick.core.Nitpick[source]

Return a single instance of the class.

Subpackages

Submodules