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