[tooling] Add a manual step to run pylint in pre-commit
This commit is contained in:
parent
e64efd8653
commit
bd9b62161a
|
@ -50,6 +50,13 @@ repos:
|
||||||
additional_dependencies: ["tox>=4.9"]
|
additional_dependencies: ["tox>=4.9"]
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
|
- id: pylint
|
||||||
|
name: pylint
|
||||||
|
entry: pylint
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
args: ["-rn", "-sn", "--fail-on=I"]
|
||||||
|
stages: [manual]
|
||||||
- id: rst
|
- id: rst
|
||||||
name: rst
|
name: rst
|
||||||
entry: rst-lint --encoding utf-8
|
entry: rst-lint --encoding utf-8
|
||||||
|
|
114
pyproject.toml
114
pyproject.toml
|
@ -165,6 +165,120 @@ lines-after-imports = 2
|
||||||
"src/_pytest/_version.py" = ["I001"]
|
"src/_pytest/_version.py" = ["I001"]
|
||||||
"testing/python/approx.py" = ["B015"]
|
"testing/python/approx.py" = ["B015"]
|
||||||
|
|
||||||
|
[tool.pylint.main]
|
||||||
|
# Maximum number of characters on a single line.
|
||||||
|
max-line-length = 120
|
||||||
|
disable= [
|
||||||
|
"abstract-method",
|
||||||
|
"arguments-differ",
|
||||||
|
"arguments-renamed",
|
||||||
|
"assigning-non-slot",
|
||||||
|
"attribute-defined-outside-init",
|
||||||
|
"bad-classmethod-argument",
|
||||||
|
"bad-mcs-method-argument",
|
||||||
|
"broad-exception-caught",
|
||||||
|
"broad-exception-raised",
|
||||||
|
"cell-var-from-loop",
|
||||||
|
"comparison-of-constants",
|
||||||
|
"comparison-with-callable",
|
||||||
|
"comparison-with-itself",
|
||||||
|
"condition-evals-to-constant",
|
||||||
|
"consider-iterating-dictionary",
|
||||||
|
"consider-using-dict-items",
|
||||||
|
"consider-using-enumerate",
|
||||||
|
"consider-using-from-import",
|
||||||
|
"consider-using-f-string",
|
||||||
|
"consider-using-in",
|
||||||
|
"consider-using-sys-exit",
|
||||||
|
"consider-using-ternary",
|
||||||
|
"consider-using-with",
|
||||||
|
"cyclic-import",
|
||||||
|
"disallowed-name",
|
||||||
|
"duplicate-code",
|
||||||
|
"eval-used",
|
||||||
|
"exec-used",
|
||||||
|
"expression-not-assigned",
|
||||||
|
"fixme",
|
||||||
|
"global-statement",
|
||||||
|
"implicit-str-concat",
|
||||||
|
"import-error",
|
||||||
|
"import-outside-toplevel",
|
||||||
|
"inconsistent-return-statements",
|
||||||
|
"invalid-bool-returned",
|
||||||
|
"invalid-name",
|
||||||
|
"invalid-repr-returned",
|
||||||
|
"invalid-str-returned",
|
||||||
|
"keyword-arg-before-vararg",
|
||||||
|
"line-too-long",
|
||||||
|
"method-hidden",
|
||||||
|
"misplaced-bare-raise",
|
||||||
|
"missing-docstring",
|
||||||
|
"missing-timeout",
|
||||||
|
"multiple-statements",
|
||||||
|
"no-else-break",
|
||||||
|
"no-else-continue",
|
||||||
|
"no-else-raise",
|
||||||
|
"no-else-return",
|
||||||
|
"no-member",
|
||||||
|
"no-name-in-module",
|
||||||
|
"no-self-argument",
|
||||||
|
"not-an-iterable",
|
||||||
|
"not-callable",
|
||||||
|
"pointless-exception-statement",
|
||||||
|
"pointless-statement",
|
||||||
|
"pointless-string-statement",
|
||||||
|
"protected-access",
|
||||||
|
"raise-missing-from",
|
||||||
|
"redefined-argument-from-local",
|
||||||
|
"redefined-builtin",
|
||||||
|
"redefined-outer-name",
|
||||||
|
"reimported",
|
||||||
|
"simplifiable-condition",
|
||||||
|
"simplifiable-if-expression",
|
||||||
|
"singleton-comparison",
|
||||||
|
"superfluous-parens",
|
||||||
|
"super-init-not-called",
|
||||||
|
"too-few-public-methods",
|
||||||
|
"too-many-ancestors",
|
||||||
|
"too-many-arguments",
|
||||||
|
"too-many-branches",
|
||||||
|
"too-many-function-args",
|
||||||
|
"too-many-instance-attributes",
|
||||||
|
"too-many-lines",
|
||||||
|
"too-many-locals",
|
||||||
|
"too-many-nested-blocks",
|
||||||
|
"too-many-public-methods",
|
||||||
|
"too-many-return-statements",
|
||||||
|
"too-many-statements",
|
||||||
|
"try-except-raise",
|
||||||
|
"typevar-name-incorrect-variance",
|
||||||
|
"unbalanced-tuple-unpacking",
|
||||||
|
"undefined-loop-variable",
|
||||||
|
"undefined-variable",
|
||||||
|
"unexpected-keyword-arg",
|
||||||
|
"unidiomatic-typecheck",
|
||||||
|
"unnecessary-comprehension",
|
||||||
|
"unnecessary-dunder-call",
|
||||||
|
"unnecessary-lambda",
|
||||||
|
"unnecessary-lambda-assignment",
|
||||||
|
"unpacking-non-sequence",
|
||||||
|
"unspecified-encoding",
|
||||||
|
"unsubscriptable-object",
|
||||||
|
"unused-argument",
|
||||||
|
"unused-import",
|
||||||
|
"unused-variable",
|
||||||
|
"used-before-assignment",
|
||||||
|
"use-dict-literal",
|
||||||
|
"use-implicit-booleaness-not-comparison",
|
||||||
|
"use-implicit-booleaness-not-len",
|
||||||
|
"useless-else-on-loop",
|
||||||
|
"useless-import-alias",
|
||||||
|
"useless-return",
|
||||||
|
"use-maxsplit-arg",
|
||||||
|
"using-constant-test",
|
||||||
|
"wrong-import-order",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.check-wheel-contents]
|
[tool.check-wheel-contents]
|
||||||
# check-wheel-contents is executed by the build-and-inspect-python-package action.
|
# check-wheel-contents is executed by the build-and-inspect-python-package action.
|
||||||
# W009: Wheel contains multiple toplevel library entries
|
# W009: Wheel contains multiple toplevel library entries
|
||||||
|
|
Loading…
Reference in New Issue