From 98019114d6b01f64cdcf38ad34abd5cc63e2accd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 24 Oct 2019 13:44:49 +0200 Subject: [PATCH] Add a PyLint CI pipeline --- .travis.yml | 23 ++++++++++++++++------- pylintrc | 33 +++++++++++++++++++++++++++++++++ tox.ini | 8 ++++++++ 3 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 pylintrc diff --git a/.travis.yml b/.travis.yml index 69ecf93..63d3ef2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,19 @@ language: python -python: -- '2.7' -- '3.4' -- '3.5' -- '3.6' -- '3.7' +sudo: false +matrix: + include: + - python: 3.7 + env: TOXENV=pylint + - python: 2.7 + env: TOXENV=py27 + - python: 3.4 + env: TOXENV=py34 + - python: 3.5 + env: TOXENV=py35 + - python: 3.6 + env: TOXENV=py36 + - python: 3.7 + env: TOXENV=py37 install: - pip install -r tests/requirements.txt -e . script: @@ -21,4 +30,4 @@ deploy: on: tags: true repo: scrapy/cssselect - condition: "$TRAVIS_PYTHON_VERSION == '3.7'" + condition: "$TOXENV == py37" diff --git a/pylintrc b/pylintrc new file mode 100644 index 0000000..b6972ec --- /dev/null +++ b/pylintrc @@ -0,0 +1,33 @@ +[MASTER] +persistent=no + +[MESSAGES CONTROL] +disable=assignment-from-no-return, + bad-continuation, + bad-whitespace, + c-extension-no-member, + consider-using-in, + fixme, + inconsistent-return-statements, + invalid-name, + missing-class-docstring, + missing-function-docstring, + missing-module-docstring, + multiple-imports, + no-else-return, + no-member, + no-self-use, + redefined-builtin, + redefined-outer-name, + too-few-public-methods, + too-many-arguments, + too-many-branches, + too-many-function-args, + too-many-lines, + too-many-public-methods, + too-many-statements, + undefined-variable, + unidiomatic-typecheck, + unused-argument, + unused-import, + useless-object-inheritance # Required for Python 2 support diff --git a/tox.ini b/tox.ini index 32136a0..430720a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,3 +7,11 @@ deps= commands = py.test --cov-report term --cov=cssselect + +[testenv:pylint] +basepython = python3.7 +deps = + {[testenv]deps} + pylint +commands = + pylint cssselect docs setup.py tests