Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects

Project description

Nitpick

PyPI Travis CI Documentation Status Coveralls Maintainability Test Coverage Supported Python versions Project License Code style: black Dependabot Status semantic-release

Flake8 plugin to enforce the same tool configuration (flake8, isort, mypy, Pylint...) across multiple Python projects.

Useful if you maintain multiple projects and want to use the same configs in all of them.

Style file

A "nitpick code style" is a TOML file with the settings that should be present in config files from other tools.

Example of a style:

["pyproject.toml".tool.black]
line-length = 120

["pyproject.toml".tool.poetry.dev-dependencies]
pylint = "*"

["setup.cfg".flake8]
ignore = "D107,D202,D203,D401"
max-line-length = 120
inline-quotes = "double"

["setup.cfg".isort]
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true

This style will assert that:

Quick setup

To try the package, simply install it (in a virtualenv or globally) and run flake8 on a project with at least one Python (.py) file:

# Install using pip:
$ pip install -U nitpick

# Or using Poetry:
$ poetry add --dev nitpick

$ flake8 .

Nitpick will download and use the opinionated default style file.

You can use it as a template to configure your own style.

Run as a pre-commit hook (recommended)

If you use pre-commit on your project (you should), add this to the .pre-commit-config.yaml in your repository:

repos:
  - repo: https://github.com/andreoliwa/nitpick
    rev: v0.23.0
    hooks:
      - id: nitpick

To install the pre-commit and commit-msg Git hooks:

pre-commit install --install-hooks
pre-commit install -t commit-msg

To start checking all your code against the default rules:

pre-commit run --all-files

For more details on styles and which configuration files are currently supported, see the full documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nitpick, version 0.23.0
Filename, size File type Python version Upload date Hashes
Filename, size nitpick-0.23.0-py3-none-any.whl (35.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nitpick-0.23.0.tar.gz (28.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page