nitpick.exceptions module

Nitpick exceptions.

class nitpick.exceptions.Deprecation[source]

Bases: object

All deprecation messages in a single class.

When it’s time to break compatibility, remove a method/warning below, and older config files will trigger validation errors on Nitpick.

static jsonfile_section(style_errors: dict[str, Any]) bool[source]

The [nitpick.JSONFile] is not needed anymore; JSON files are now detected by the extension.

static pre_commit_repos_with_yaml_key() bool[source]

The pre-commit config should not have the “repos.yaml” key anymore; this is the old style.

Slight breaking change in the TOML config format: ditching the old TOML config.

static pre_commit_without_dash(path_from_root: str) bool[source]

The pre-commit config should start with a dot on the config file.

exception nitpick.exceptions.QuitComplainingError(violations: Fuss | list[Fuss])[source]

Bases: Exception

Quit complaining and exit the application.

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

nitpick.exceptions.pretty_exception(err: Exception, message: str = '')[source]

Return a pretty error message with the full path of the Exception.