Skip to content
Commits on Source (6)
[tool.flakeheaven]
colored = true
max_line_length = 92
max_doc_length = 92
[tool.flakeheaven.plugins] [tool.flakeheaven.plugins]
mccabe = [ mccabe = [
"+C", "+C",
...@@ -6,7 +11,7 @@ pycodestyle = [ ...@@ -6,7 +11,7 @@ pycodestyle = [
# Warnings not considered, many are not relevant to Python ~=3.9 and will # Warnings not considered, many are not relevant to Python ~=3.9 and will
# cause syntax errors anyway, others concern whitespace which is fixed by # cause syntax errors anyway, others concern whitespace which is fixed by
# a pre-commit hook. # a pre-commit hook.
"+E*", "+E*", "-W*",
# DISABLE "Continuation line missing indentation or outdented" # DISABLE "Continuation line missing indentation or outdented"
"-E122", "-E122",
...@@ -114,6 +119,12 @@ flake8-print = [ ...@@ -114,6 +119,12 @@ flake8-print = [
] ]
flake8-return = [ flake8-return = [
"+R*", "+R*",
# DISABLE "missing explicit return at the end of function able to return
# non-None value"
# Mypy will report this, plugin also cannot do exhaustiveness check of match
# block, leading to false-positives.
"-R503",
] ]
[tool.flakeheaven.exceptions."**/__init__.py"] [tool.flakeheaven.exceptions."**/__init__.py"]
......
...@@ -6,3 +6,6 @@ ...@@ -6,3 +6,6 @@
# Test results # Test results
/results/ /results/
# Pre-Commit hooks
/.*cache/
default_stages: [commit] default_stages: [commit]
default_install_hook_types: [pre-commit, pre-push, commit-msg]
repos: repos:
- repo: meta - repo: meta
...@@ -7,7 +9,7 @@ repos: ...@@ -7,7 +9,7 @@ repos:
- id: check-useless-excludes - id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.5.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-case-conflict - id: check-case-conflict
...@@ -52,7 +54,7 @@ repos: ...@@ -52,7 +54,7 @@ repos:
- id: python-use-type-annotations - id: python-use-type-annotations
- repo: https://github.com/hakancelikdev/unimport - repo: https://github.com/hakancelikdev/unimport
rev: 0.16.0 rev: 1.0.0
hooks: hooks:
- id: unimport - id: unimport
args: ["--remove", "--include=\\.pyi?$"] args: ["--remove", "--include=\\.pyi?$"]
...@@ -67,10 +69,9 @@ repos: ...@@ -67,10 +69,9 @@ repos:
stages: [commit, manual] stages: [commit, manual]
- repo: https://github.com/asottile/add-trailing-comma - repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0 rev: v3.1.0
hooks: hooks:
- id: add-trailing-comma - id: add-trailing-comma
args: [--py36-plus]
types: [] types: []
types_or: [python, pyi] types_or: [python, pyi]
stages: [commit, manual] stages: [commit, manual]
...@@ -85,9 +86,10 @@ repos: ...@@ -85,9 +86,10 @@ repos:
- flake8-print - flake8-print
- flake8-return - flake8-return
- flake8-sfs - flake8-sfs
- pydocstyle[toml]
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0 rev: v1.6.1
hooks: hooks:
- id: mypy - id: mypy
args: [--follow-imports=silent, project_templates] args: [--follow-imports=silent, project_templates]
......
...@@ -40,6 +40,7 @@ new-project = "project_templates:main" ...@@ -40,6 +40,7 @@ new-project = "project_templates:main"
[tool.isort] [tool.isort]
force_single_line = true force_single_line = true
line_length = 92
[tool.unimport] [tool.unimport]
...@@ -48,8 +49,6 @@ ignore-init = true ...@@ -48,8 +49,6 @@ ignore-init = true
[tool.flakeheaven] [tool.flakeheaven]
base = ".flakerules.toml" base = ".flakerules.toml"
max_line_length = 92
max_doc_length = 92
[tool.mypy] [tool.mypy]
...@@ -74,7 +73,9 @@ exclude_lines = [ ...@@ -74,7 +73,9 @@ exclude_lines = [
"if .*\\b__name__\\b", "if .*\\b__name__\\b",
"if .*\\bTYPE_CHECKING\\b", "if .*\\bTYPE_CHECKING\\b",
"class .*(.*\\bProtocol\\b.*):", "class .*(.*\\bProtocol\\b.*):",
"def __repr__",
"@overload", "@overload",
"@(abc\\.)abstractmethod",
] ]
partial_branches = [ partial_branches = [
"pragma: no branch", "pragma: no branch",
......