Skip to content

Commit 9dc72f0

Browse files
authored
Merge pull request #524 from JohnVillalovos/jlvillal/pylint
chore: add initial `pylint` check
2 parents 5f67f16 + e03736d commit 9dc72f0

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ jobs:
3232
run: tox -e isort -- --check
3333
- name: Run flake8 (https://flake8.pycqa.org/en/latest/)
3434
run: tox -e flake8
35+
- name: Run pylint Python code static checker (https://github.com/PyCQA/pylint)
36+
run: tox -e pylint

pyproject.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,50 @@ module = [
6565
"setup",
6666
]
6767
ignore_errors = true
68+
69+
[tool.pylint.messages_control]
70+
max-line-length = 88
71+
jobs = 0 # Use auto-detected number of multiple processes to speed up Pylint.
72+
# TODO(jlvillal): Work on removing these disables over time.
73+
disable = [
74+
"attribute-defined-outside-init",
75+
"bad-classmethod-argument",
76+
"broad-exception-caught",
77+
"consider-using-f-string",
78+
"consider-using-in",
79+
"consider-using-ternary",
80+
"consider-using-with",
81+
"deprecated-method",
82+
"fixme",
83+
"import-error",
84+
"import-outside-toplevel",
85+
"inconsistent-return-statements",
86+
"invalid-name",
87+
"line-too-long",
88+
"missing-class-docstring",
89+
"missing-function-docstring",
90+
"missing-module-docstring",
91+
"no-else-break",
92+
"no-else-continue",
93+
"no-else-return",
94+
"no-value-for-parameter",
95+
"protected-access",
96+
"raise-missing-from",
97+
"signature-differs",
98+
"simplifiable-if-statement",
99+
"super-with-arguments",
100+
"too-few-public-methods",
101+
"too-many-arguments",
102+
"too-many-boolean-expressions",
103+
"too-many-branches",
104+
"too-many-instance-attributes",
105+
"too-many-lines",
106+
"too-many-public-methods",
107+
"try-except-raise",
108+
"undefined-loop-variable",
109+
"unnecessary-pass",
110+
"unused-argument",
111+
"use-dict-literal",
112+
"use-list-literal",
113+
"useless-object-inheritance",
114+
]

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ black==22.3.0
33
flake8==4.0.1
44
isort==5.12.0
55
mypy==1.5.1
6+
pylint==2.17.5

tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
skipsdist = True
33
minversion = 3.0
4-
envlist=py37,py38,py39,py310,py311,black,isort,flake8,mypy
4+
envlist=py37,py38,py39,py310,py311,black,isort,flake8,mypy,pylint
55

66
[testenv]
77
commands=python -m unittest
@@ -27,6 +27,11 @@ basepython = python3
2727
commands =
2828
mypy {posargs}
2929

30+
[testenv:pylint]
31+
basepython = python3
32+
commands =
33+
pylint {posargs} imapclient/
34+
3035
[flake8]
3136
exclude = .git,.venv,.tox,dist,doc,*egg,build,
3237
max-line-length = 88

0 commit comments

Comments
 (0)