Skip to content

Commit 17846a3

Browse files
committed
tests: move pylint config to pyproject.toml
It makes it easier to configure pylint Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
1 parent c8fa501 commit 17846a3

File tree

2 files changed

+48
-11
lines changed

2 files changed

+48
-11
lines changed

tests/integration_tests/style/test_python.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,7 @@ def test_python_pylint():
2828
Test that python code passes linter checks.
2929
"""
3030
# List of linter commands that should be executed for each file
31-
linter_cmd = (
32-
# Pylint
33-
"pylint --jobs=0 --persistent=no --score=no "
34-
'--output-format=colorized --attr-rgx="[a-z_][a-z0-9_]{1,30}$" '
35-
'--argument-rgx="[a-z_][a-z0-9_]{1,35}$" '
36-
'--variable-rgx="[a-z_][a-z0-9_]{1,30}$" --disable='
37-
"fixme,too-many-instance-attributes,import-error,"
38-
"too-many-locals,too-many-arguments,consider-using-f-string,"
39-
"consider-using-with,implicit-str-concat,line-too-long,redefined-outer-name,"
40-
"broad-exception-raised,duplicate-code,too-many-positional-arguments tests tools .buildkite/*.py"
41-
)
31+
linter_cmd = "pylint --rcfile tests/pyproject.toml --output-format=colorized tests/ tools/ .buildkite/*.py"
4232
run(
4333
linter_cmd,
4434
# we let pytest capture stdout/stderr for us

tests/pyproject.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,50 @@ exclude = "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|
88
# https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html
99
multi_line_output = 3
1010
profile = "black"
11+
12+
[tool.pylint.main]
13+
14+
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
15+
# number of processors available to use, and will cap the count on Windows to
16+
# avoid hangs.
17+
jobs = 0
18+
19+
score = false
20+
21+
# Pickle collected data for later comparisons.
22+
persistent = false
23+
24+
# Disable the message, report, category or checker with the given id(s). You can
25+
# either give multiple identifiers separated by comma (,) or put this option
26+
# multiple times (only on the command line, not in the configuration file where
27+
# it should appear only once). You can also use "--disable=all" to disable
28+
# everything first and then re-enable specific checks. For example, if you want
29+
# to run only the similarities checker, you can use "--disable=all
30+
# --enable=similarities". If you want to run only the classes checker, but have
31+
# no Warning level messages displayed, use "--disable=all --enable=classes
32+
# --disable=W".
33+
disable = [
34+
"raw-checker-failed",
35+
"bad-inline-option",
36+
"locally-disabled",
37+
"file-ignored",
38+
"suppressed-message",
39+
"useless-suppression",
40+
"deprecated-pragma",
41+
"use-implicit-booleaness-not-comparison-to-string",
42+
"use-implicit-booleaness-not-comparison-to-zero",
43+
"use-symbolic-message-instead",
44+
"fixme",
45+
"too-many-instance-attributes",
46+
"import-error",
47+
"too-many-locals",
48+
"too-many-arguments",
49+
"consider-using-f-string",
50+
"consider-using-with",
51+
"implicit-str-concat",
52+
"line-too-long",
53+
"redefined-outer-name",
54+
"broad-exception-raised",
55+
"duplicate-code",
56+
"too-many-positional-arguments",
57+
]

0 commit comments

Comments
 (0)