Usage¶
flake2lint¶
Augment Flake8 noqa comments with PyLint comments.
flake2lint [OPTIONS] [FILENAMES]...
Options
-
-v,--verbose¶ Show verbose output.
-
-r,--recursive¶ Permits the use of the pattern ‘**’ to match any files, directories and subdirectories.
Arguments
-
FILENAMES¶ Optional argument(s). Default
None
Changed in version 0.3.0: Added the -v / --verbose option.
pre-commit hook¶
Sample .pre-commit-config.yaml:
- repo: https://github.com/domdfcoding/flake2lint
rev: v0.4.0
hooks:
- id: flake2lint
See pre-commit for further information.
Supported Flake8 Codes¶
flake2lint currently augments the following flake8 codes:
A001➞redefined-builtinNew in version 0.4.0.
A002➞redefined-builtinA003➞redefined-builtin
Contributions to add support for more codes are more than welcome. The relevant code is here.
Example¶
Before:
class FancyDialog(wx.Dialog):
def __init__(
self,
parent,
id=wx.ID_ANY, # noqa: A002
title="My Fancy Dialog",
pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE,
name=wx.DialogNameStr,
data=None
): ...
After:
class FancyDialog(wx.Dialog):
def __init__(
self,
parent,
id=wx.ID_ANY, # noqa: A002 # pylint: disable=redefined-builtin
title="My Fancy Dialog",
pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE,
name=wx.DialogNameStr,
data=None
): ...