summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-20 12:30:48 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-20 14:32:11 +0200
commit62f57dd03da0378308c32f3707c71d9c65f87759 (patch)
treecb8975e49ccd3eaa901005a776605969dc747ac8
parent7471bd6903020b8604b35c9d3e391b602757aa99 (diff)
downloadpylint-git-62f57dd03da0378308c32f3707c71d9c65f87759.tar.gz
[tox] Extend the pylint check to the relevant parts in tests
The change required would be huge, so we created a configuration file for tests so we can enable rule progressively. We can't add an __init__.py in test to make the command easier to launch because there would be too much imports to modify. So we hard coded the files and directory to lint until https://github.com/PyCQA/pylint/issues/352 is fixed.
-rw-r--r--tests/.test_pylintrc40
-rw-r--r--tests/utils/__init__.py0
-rw-r--r--tox.ini21
3 files changed, 58 insertions, 3 deletions
diff --git a/tests/.test_pylintrc b/tests/.test_pylintrc
new file mode 100644
index 000000000..dc8b4dc7c
--- /dev/null
+++ b/tests/.test_pylintrc
@@ -0,0 +1,40 @@
+# The idea is to use this file and remove disabled rule until we're able to merge with the pylintrc used for pylint
+# itself once the change required to fix are small enough
+
+[master]
+ignore=functional,input,data,regrtest_data
+
+[MESSAGES CONTROL]
+disable=
+ attribute-defined-outside-init,
+ duplicate-code,
+ invalid-name,
+ missing-docstring,
+ protected-access,
+ too-few-public-methods,
+ # handled by black
+ format,
+ redefined-outer-name,
+ misplaced-comparison-constant,
+ import-outside-toplevel,
+ no-self-use,
+ abstract-method,
+ function-redefined,
+ unused-import,
+ unnecessary-pass,
+ too-many-public-methods,
+ unused-argument,
+ unused-wildcard-import,
+ undefined-loop-variable,
+ unused-variable,
+ no-member,
+ missing-type-doc,
+ bare-except,
+ too-many-ancestors,
+ implicit-str-concat,
+ wildcard-import,
+ singleton-comparison,
+ pointless-statement,
+ fixme,
+ pointless-string-statement,
+ super-init-not-called,
diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/utils/__init__.py
diff --git a/tox.ini b/tox.ini
index 01f9b71ba..a6df70a14 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,9 +7,24 @@ deps =
git+https://github.com/pycqa/astroid@master
isort
pytest
-
-commands = pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe {envsitepackagesdir}/pylint
-
+commands =
+ pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe {envsitepackagesdir}/pylint
+ # This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
+ pylint -rn --rcfile={toxinidir}/tests/.test_pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
+ {toxinidir}/tests/message/ {toxinidir}/tests/extensions/ {toxinidir}/tests/utils/ {toxinidir}/tests/acceptance/ {toxinidir}/tests/conftest.py \
+ {toxinidir}/tests/test_config.py {toxinidir}/tests/test_func.py {toxinidir}/tests/test_functional.py \
+ {toxinidir}/tests/test_import_graph.py {toxinidir}/tests/test_pragma_parser.py {toxinidir}/tests/test_pylint_runners.py \
+ {toxinidir}/tests/test_regr.py {toxinidir}/tests/test_self.py {toxinidir}/tests/unittest_checker_base.py \
+ {toxinidir}/tests/unittest_checker_classes.py {toxinidir}/tests/unittest_checker_exceptions.py \
+ {toxinidir}/tests/unittest_checker_format.py {toxinidir}/tests/unittest_checker_imports.py \
+ {toxinidir}/tests/unittest_checker_logging.py {toxinidir}/tests/unittest_checker_misc.py \
+ {toxinidir}/tests/unittest_checker_python3.py {toxinidir}/tests/unittest_checker_similar.py \
+ {toxinidir}/tests/unittest_checker_spelling.py {toxinidir}/tests/unittest_checker_stdlib.py \
+ {toxinidir}/tests/unittest_checker_strings.py {toxinidir}/tests/unittest_checkers_utils.py \
+ {toxinidir}/tests/unittest_checker_typecheck.py {toxinidir}/tests/unittest_checker_variables.py \
+ {toxinidir}/tests/unittest_config.py {toxinidir}/tests/unittest_lint.py {toxinidir}/tests/unittest_pyreverse_diadefs.py \
+ {toxinidir}/tests/unittest_pyreverse_inspector.py {toxinidir}/tests/unittest_pyreverse_writer.py \
+ {toxinidir}/tests/unittest_reporters_json.py {toxinidir}/tests/unittest_reporting.py
[testenv:formatting]
basepython = python3