Skip to main content

A pylint plugin to ignore error codes per file.

Project description

Pylint Per File Ignores 😲

This pylint plugin will enable per-file-ignores in your project!

Install

# w/ poetry
poetry add --dev pylint-per-file-ignores

# w/ pip
pip install pylint-per-file-ignores

Add to Pylint Settings

[tool.pylint.MASTER]
load-plugins=[
    "pylint_per_file_ignores",
    ...
]

Usage

Add list of patterns and codes you would like to ignore.

Using native pylint settings

Section "MESSAGES CONTROL". Examples:

# setup.cfg

[pylint.MESSAGES CONTROL]
per-file-ignores =
  /folder_1/:missing-function-docstring,W0621,W0240,C0115
  file.py:C0116,E0001
# pyproject.toml

[tool.pylint.'MESSAGES CONTROL']
per-file-ignores = [
    "/folder_1/:missing-function-docstring,W0621,W0240,C0115",
    "file.py:C0116,E0001"
]

Using custom pyproject.toml section

For backwards compatibility only. Example:

[tool.pylint-per-file-ignores]
"/folder_1/"="missing-function-docstring,W0621,W0240,C0115"
"file.py"="C0116,E0001"

Thanks

To pylint :) And the plugin pylint-django who produced most of the complex code.

Contributing

This repo uses commitizen and semantic release. Please commit using npm run commit .

Project details


Download files

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

Source Distribution

pylint_per_file_ignores-1.3.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pylint_per_file_ignores-1.3.2-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page