Skip to content

Commit 9ac8365

Browse files
committed
enable pylint via pants
1 parent 395c869 commit 9ac8365

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pants.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ backend_packages = [
1515
"pants.backend.python.lint.bandit",
1616
"pants.backend.python.lint.black",
1717
"pants.backend.python.lint.flake8",
18+
"pants.backend.python.lint.pylint",
1819

1920
# shell
2021
"pants.backend.shell",
@@ -96,7 +97,7 @@ interpreter_constraints = [
9697

9798
[python.resolves]
9899
st2 = "lockfiles/st2.lock"
99-
pylint_plugins = "lockfiles/pylint_plugins.lock"
100+
pylint_plugins = "lockfiles/pylint_plugins.lock" # lockfiles/pylint.lock should have same contents
100101

101102
[python.resolves_to_constraints_file]
102103
# Our direct requirements are in requirements-pants.txt;
@@ -146,10 +147,22 @@ extra_requirements = [
146147
config = "lint-configs/python/.flake8"
147148

148149
[pylint]
150+
lockfile = "lockfiles/pylint.lock"
149151
version = "pylint~=2.8.2"
150152
extra_requirements = [
151153
"setuptools", # includes pkg_resources
152154
]
155+
config = "lint-configs/python/.pylintrc"
156+
source_plugins = [
157+
# the /pylint_plugins directory
158+
"pylint_plugins",
159+
]
160+
args = [
161+
# needed in st2* components, runners, packs
162+
"--load-plugins=pylint_plugins.api_models",
163+
# needed in st2* components, runners
164+
"--load-plugins=pylint_plugins.db_models",
165+
]
153166

154167
[regex-lint]
155168
config = "@lint-configs/regex-lint.yaml"

0 commit comments

Comments
 (0)