Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
detect mccabe
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Oct 2, 2019
1 parent e03f497 commit 4cb4f92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions flakehell/_constants.py
Expand Up @@ -60,6 +60,7 @@ class ExitCodes(IntEnum):
# 'flake8-strict',
'flake8-string-format',
'flake8-variables-names',
'mccabe',
'pep8-naming',

# built-in in flake8
Expand Down
9 changes: 8 additions & 1 deletion flakehell/_logic/_extractors.py
Expand Up @@ -14,7 +14,7 @@
class CollectStrings(ast.NodeVisitor):
_strings = []

def visit_Str(self, node):
def visit_Str(self, node): # noqa: N802
self._strings.append(node.s)


Expand Down Expand Up @@ -281,6 +281,13 @@ def extract_dlint():
return codes


def extract_mccabe():
from mccabe import McCabeChecker

code, message = McCabeChecker._error_tmpl.split(' ', maxsplit=1)
return {code: message}


def extract_wemake_python_styleguide():
from wemake_python_styleguide import violations

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -114,6 +114,7 @@ dev = [
"flake8-strict",
"flake8-string-format",
"flake8-variables-names",
"mccabe",
"pep8-naming",
"pylint",
"wemake-python-styleguide",
Expand Down

0 comments on commit 4cb4f92

Please sign in to comment.