Pylint CI improvements

* Move the pylint CI configuration to a separate script
* Update pylint in CI to 2.1.1
* Add pycurl to pylint whitelist
This commit is contained in:
Marcin Mielniczuk 2018-09-27 16:03:08 +02:00 committed by Philipp Hörist
parent 38ac6a0637
commit 9328475c22
5 changed files with 49 additions and 41 deletions

View File

@ -1,6 +1,7 @@
before_script:
- sudo apt-get update -qq && sudo apt-get install -y -qq libtool pkg-config python3-openssl gir1.2-gtk-3.0 python3-gi python3-nbxmpp-nightly pylint3 python3-cairo
- sudo apt-get update -qq && sudo apt-get install -y -qq libtool pkg-config python3-openssl gir1.2-gtk-3.0 python3-gi python3-nbxmpp-nightly python3-cairo python3-pip
- sudo apt-get build-dep -y -qq gajim-default-nightly
- sudo pip3 install pylint==2.1.1
stages:
- test
@ -19,7 +20,9 @@ run-mypy:
run-pylint:
stage: test
script:
- pylint3 --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 gajim
- pylint3 --version
- pylint --version
- scripts/dev/pylint-ci.sh --jobs=2 gajim
run-build:
stage: build

View File

@ -1031,7 +1031,7 @@ class Connection(CommonConnection, ConnectionHandlers):
nbxmpp.dispatcher_nb.DEFAULT_TIMEOUT_SECONDS = \
self.try_connecting_for_foo_secs
# FIXME: this is a hack; need a better way
if self.on_connect_success == self._on_new_account:
if self.on_connect_success == self._on_new_account: # pylint: disable=comparison-with-callable
con.RegisterDisconnectHandler(self._on_new_account)
if self.client_cert and app.config.get_per('accounts', self.name,

View File

@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
extension-pkg-whitelist=pycurl
# Add files or directories to the blacklist. They should be base names, not
# paths.

View File

@ -1,38 +1,4 @@
mypy gajim
pylint --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 gajim
SCRIPTDIR=$(dirname $0)
# C0103 invalid-name
# C0302 too-many-lines
# C0330 bad-continuation
# C0411 wrong-import-order
# C0412 ungrouped-imports
# C0413 wrong-import-position
# E0203 access-member-before-definition
# E0401 import-error
# E0611 no-name-in-module
# E0710 raising-non-exception - GLib.GError is not recognized
# E0712 catching-non-exception - GLib.GError is not recognized
# E1101 no-member
# E1102 not-callable
# E1128 assignment-from-none
# E1133 not-an-iterable
# E1136 unsubscriptable-object
# R0201 no-self-use
# R0901 too-many-ancestors
# R0904 too-many-public-methods
# R0913 too-many-arguments
# R0916 too-many-boolean-expressions
# R1702
# R1706
# R1711
# R1716
# W0143 comparison-with-callable - Dont add to Server CI, only available on pylint 2.0+
# W0201 attribute-defined-outside-init
# W0212 protected-access
# W0221 arguments-differ
# W0223 abstract-method
# W0311 bad-indentation
# W0401 wildcard-import
# W0603 global-statement
# W0613 unused-argument
# W0614 unused-wildcard-import
mypy gajim
${SCRIPTDIR}/pylint-ci.sh --jobs=0 gajim

39
scripts/dev/pylint-ci.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
PYLINT=${PYLINT:-pylint}
"$PYLINT" --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 "$@"
# C0103 invalid-name
# C0302 too-many-lines
# C0330 bad-continuation
# C0411 wrong-import-order
# C0412 ungrouped-imports
# C0413 wrong-import-position
# E0203 access-member-before-definition
# E0401 import-error
# E0611 no-name-in-module
# E0710 raising-non-exception - GLib.GError is not recognized
# E0712 catching-non-exception - GLib.GError is not recognized
# E1101 no-member
# E1102 not-callable
# E1128 assignment-from-none
# E1133 not-an-iterable
# E1136 unsubscriptable-object
# R0201 no-self-use
# R0901 too-many-ancestors
# R0904 too-many-public-methods
# R0913 too-many-arguments
# R0916 too-many-boolean-expressions
# R1702
# R1706
# R1711
# R1716
# W0201 attribute-defined-outside-init
# W0212 protected-access
# W0221 arguments-differ
# W0223 abstract-method
# W0311 bad-indentation
# W0401 wildcard-import
# W0603 global-statement
# W0613 unused-argument
# W0614 unused-wildcard-import