Flake8 Putty allows more control over errors reported by flake8, without adding noqa for every erroneous or undesirable error detected.
See https://gitlab.com/pycqa/flake8/issues/89 for some of the motivation for this extension.
If you only want better noqa support, flake8-respect-noqa is a simpler extension which works only when multiprocessing is disabled.
Disabling erroneous or undesirable errors by adding noqa in the code may be undesirable for a number of reasons, including:
the ‘error’ appears frequently
the module is strictly in maintenance mode only
it causes a line to break the line length rule
the error should be ignored on only some versions or platforms
Installation
Simply:
$ pip install flake8-putty
Check that flake8 finds it:
$ flake8 --version 2.4.1 (pep8: 1.5.7, flake8-putty: 0.3.2, mccabe: 0.3.1, pyflakes: 0.8.1) CPython 2.7.6 on Linux
Usage
flake8-putty is not activated unless putty-auto-ignore, putty-ignore or putty-select appear in the configuration file or command line options.
Auto ignore detects comments on each line like .. # flake8: disable=xxxx.
putty-ignore and putty-select both support multiline values, and each line is a rule which should have the format:
<selectors> : <modifier><codes>
The codes are flake8 codes to use when the rule is matched. The only modifier is + which appends the codes to the list of codes from other rules.
Selectors may contain one or more of: - file patterns - line regexes - flake8 codes
When multiple file pattern selectors are used, only one of the file patterns needs to match the filename. Likewise only one of many regex and only one of many codes needs to be matched.
However when different types of selectors are combined in one rule, each type of selector must be matched.
e.g. when two filenames and two regex are used, at least one filename and one regex must match before the rule is activated.
All matching rules are processed.
Examples
Disable only D102 on foo.py
- putty-ignore =
foo.py : D102
Disable D205, D400 and D401 for __init__ methods:
- putty-ignore =
/__init__/ : +D205,D400,D401
Disable T001 only when it is explicitly mentioned
- putty-ignore =
/# !qa:.*T001/ : +T001
Disable any code that is explicitly mentioned
- putty-ignore =
/# !qa: (?P<codes>[A-Z0-9, ])/ : +(?P<codes>)
Disable any code that occurs after # flake8: disable=
putty-auto-ignore = True
Metadata
Release files for flake8-putty 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flake8-putty-0.4.0.tar.gz | 13.5 kB | Without provenance | Details for flake8-putty-0.4.0.tar.gz |
Release files / flake8-putty-0.4.0.tar.gz
| Download URL | flake8-putty-0.4.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aee125053aeafb9bcc7973bcaf4882c8881f5df7141b85902e7f3d3be530b270
|
|
BLAKE2b-256 checksum How to use checksums |
92d7aaac220117a833813a4283afba377461fe6ce295d5688a4ef155b861f510
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flake8-putty 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.