All Projects → jayvdb → flake8-putty

jayvdb / flake8-putty

Licence: MIT license
Flake8 plugin to control reporting per file and line

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to flake8-putty

flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (+123.68%)
Mutual labels:  linter, flake8-plugin
flake8-simplify
❄ A flake8 plugin that helps you to simplify code
Stars: ✭ 97 (+155.26%)
Mutual labels:  linter, flake8-plugin
flake8-aaa
A Flake8 plugin that checks Python tests follow the Arrange-Act-Assert pattern
Stars: ✭ 51 (+34.21%)
Mutual labels:  linter, flake8-plugin
Wemake Python Styleguide
The strictest and most opinionated python linter ever!
Stars: ✭ 1,714 (+4410.53%)
Mutual labels:  linter, flake8-plugin
Eslint Plugin Markdown
Lint JavaScript code blocks in Markdown documents
Stars: ✭ 242 (+536.84%)
Mutual labels:  linter
Protoc Gen Lint
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
Stars: ✭ 221 (+481.58%)
Mutual labels:  linter
Lightline Ale
ALE indicator for the lightline vim plugin
Stars: ✭ 217 (+471.05%)
Mutual labels:  linter
Godot Gdscript Toolkit
Independent set of GDScript tools - parser, linter and formatter
Stars: ✭ 214 (+463.16%)
Mutual labels:  linter
tryceratops
A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).
Stars: ✭ 381 (+902.63%)
Mutual labels:  linter
Html5validator
Command line tool to validate HTML5 files. Great for continuous integration.
Stars: ✭ 251 (+560.53%)
Mutual labels:  linter
Django Migration Linter
🚀 Detect backward incompatible migrations for your django project
Stars: ✭ 231 (+507.89%)
Mutual labels:  linter
D Scanner
Swiss-army knife for D source code
Stars: ✭ 221 (+481.58%)
Mutual labels:  linter
Sql Lint
An SQL linter
Stars: ✭ 243 (+539.47%)
Mutual labels:  linter
Neomake
Asynchronous linting and make framework for Neovim/Vim
Stars: ✭ 2,512 (+6510.53%)
Mutual labels:  linter
typo3-typoscript-lint
Find coding errors in your TypoScript files.
Stars: ✭ 78 (+105.26%)
Mutual labels:  linter
Flakehell
Flake8 wrapper to make it nice, legacy-friendly, configurable.
Stars: ✭ 217 (+471.05%)
Mutual labels:  linter
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+8160.53%)
Mutual labels:  linter
Best Of Python Dev
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
Stars: ✭ 243 (+539.47%)
Mutual labels:  linter
Querly
Query Method Calls from Ruby Programs
Stars: ✭ 226 (+494.74%)
Mutual labels:  linter
Pythonbuddy
Online Python Editor With Live Syntax Checking and Execution
Stars: ✭ 223 (+486.84%)
Mutual labels:  linter

Flake8 Putty

Build Status Coverage Status Code Quality Pypi Entry

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.

flake8-putty requires flake8 2. If you are looking for an extension compatible with flake8 3 that supports a subset of flake8-putty, see flake8-per-file-ignores.

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].