Skip to content

Commit

Permalink
change C90 / max-complexity settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Mar 16, 2024
1 parent 81f560f commit 044ebde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyglossary/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ def _outputPluginByFormat(
# return "tuple[DetectedFormat | None, str]"
# where the str is error
# and remove `quiet` argument, and local `error` function
# also: C901 `detectOutputFormat` is too complex (16 > 13)
@classmethod
def detectOutputFormat( # noqa: PLR0913
def detectOutputFormat( # noqa: PLR0913, C901
cls: "type[PluginManager]",
filename: str = "",
format: str = "",
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lint.select = [
"F", # Pyflakes
"E", # pycodestyle Error
"W", # pycodestyle Warning
# "C90", # mccabe: C901: {name} is too complex ({complexity})
"C90", # mccabe: C901: {name} is too complex ({complexity})
"I", # isort: unsorted-imports, missing-required-import
# "N", # pep8-naming
"D", # pydocstyle
Expand Down Expand Up @@ -181,6 +181,7 @@ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"pyglossary/plugins/**/*.py" = [
"PLR0904", # Too many public methods
"C90", # mccabe: C901: {name} is too complex ({complexity})
]
"slob.py" = [
]
Expand Down Expand Up @@ -217,6 +218,7 @@ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
"PERF203",
"PLR0904", # Too many public methods
"PLR6301", # Method `...` could be a function, class method, or static method
"C90", # mccabe: C901: {name} is too complex ({complexity})
]
"tests/*.py" = [
"ANN",
Expand Down Expand Up @@ -248,7 +250,7 @@ exclude = [

[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 20
max-complexity = 13

[tool.mypy]
exclude = [
Expand Down

0 comments on commit 044ebde

Please sign in to comment.