nitpick.violations module
Violation codes.
Name inspired by flake8’s violations.
- class nitpick.violations.Fuss(fixed: bool, filename: str, code: int, message: str, suggestion: str = '', lineno: int = 1)[source]
Bases:
object
Nitpick makes a fuss when configuration doesn’t match.
Fields inspired on
SyntaxError
and pyflakes.messages.Message.
- class nitpick.violations.ProjectViolations(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
ViolationEnum
Project initialization violations.
- FILE_SHOULD_BE_DELETED = (104, ' should be deleted{extra}')
- MINIMUM_VERSION = (203, "The style file you're using requires {project}>={expected} (you have {actual}). Please upgrade")
- MISSING_FILE = (103, ' should exist{extra}')
- NO_PYTHON_FILE = (102, 'No Python file was found on the root dir and subdir of {root!r}')
- NO_ROOT_DIR = (101, "No root directory detected. Run 'nitpick init' or configure a style manually (.nitpick.toml, pyproject.toml). See https://nitpick.rtfd.io/en/latest/configuration.html")
- class nitpick.violations.Reporter(info: FileInfo | None = None, violation_base_code: int = 0)[source]
Bases:
object
Error reporter.
- make_fuss(violation: ViolationEnum, suggestion: str = '', fixed=False, **kwargs) Fuss [source]
Make a fuss.
Bases:
ViolationEnum
Shared violations used by all plugins.
- class nitpick.violations.StyleViolations(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
ViolationEnum
Style violations.
- INVALID_CONFIG = (1, ' has an incorrect style. Invalid config:')
- INVALID_DATA_TOOL_NITPICK = (1, ' has an incorrect style. Invalid data in [{section}]:')
- INVALID_TOML = (1, ' has an incorrect style. Invalid TOML{exception}')
- NO_STYLE_CONFIGURED = (4, "No style file configured. Run 'nitpick init' or configure a style manually (.nitpick.toml, pyproject.toml). See https://nitpick.rtfd.io/en/latest/configuration.html")