misc: update pylint configuration (#56982)

This commit is contained in:
Valentin Deniaud 2021-09-16 16:45:27 +02:00
parent 2df4447604
commit e2079747b7
3 changed files with 73 additions and 7 deletions

View File

@ -1,12 +1,63 @@
[MASTER]
profile=no
persistent=yes
ignore=migrations
cache-size=500
load-plugins=pylint_django
[MESSAGES CONTROL]
disable=abstract-method,arguments-differ,assignment-from-no-return,assignment-from-none,attribute-defined-outside-init,broad-except,consider-using-dict-comprehension,consider-using-set-comprehension,consider-using-ternary,cyclic-import,deprecated-module,duplicate-code,duplicate-except,eval-used,exec-used,fixme,global-variable-undefined,import-outside-toplevel,inconsistent-return-statements,invalid-name,keyword-arg-before-vararg,len-as-condition,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-return,no-member,no-self-use,non-parent-init-called,not-a-mapping,not-callable,possibly-unused-variable,protected-access,raise-missing-from,redefined-argument-from-local,redefined-builtin,redefined-outer-name,signature-differs,stop-iteration-return,subprocess-run-check,super-init-not-called,superfluous-parens,too-many-ancestors,too-many-arguments,too-many-boolean-expressions,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-nested-blocks,too-many-public-methods,too-many-return-statements,too-many-statements,undefined-loop-variable,unnecessary-comprehension,unnecessary-lambda,unsubscriptable-object,unsupported-membership-test,unused-argument
disable=
abstract-method,
arguments-differ,
assignment-from-none,
attribute-defined-outside-init,
bad-super-call,
broad-except,
consider-using-dict-comprehension,
consider-using-set-comprehension,
cyclic-import,
duplicate-code,
exec-used,
fixme,
global-variable-undefined,
import-outside-toplevel,
inconsistent-return-statements,
invalid-name,
keyword-arg-before-vararg,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
no-else-return,
no-member,
no-self-use,
non-parent-init-called,
not-callable,
possibly-unused-variable,
protected-access,
raise-missing-from,
redefined-argument-from-local,
redefined-builtin,
redefined-outer-name,
signature-differs,
stop-iteration-return,
super-init-not-called,
superfluous-parens,
too-many-ancestors,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-return-statements,
too-many-statements,
undefined-loop-variable,
unnecessary-comprehension,
unspecified-encoding,
unsubscriptable-object,
unsupported-membership-test,
unused-argument,
use-a-generator,
c-extension-no-member,
consider-using-f-string
[REPORTS]
@ -38,16 +89,16 @@ zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed.
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
# List of method names used to declare (i.e. assign) instance attributes
defining-attr-methods=__init__,__new__
defining-attr-methods=__init__,__new__,setUp
[VARIABLES]
init-import=no
dummy-variables-rgx=_|dummy
good-names=_,i,j,k,fd
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
[SIMILARITIES]
min-similarity-lines=6

5
pylint.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -e -x
env
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0

12
tox.ini
View File

@ -66,6 +66,8 @@ deps =
pytz
pytest-freezegun
faker
pylint
pylint-django
enum34<=1.1.6
ldaptools>=0.15
oldldap: python-ldap<3
@ -100,9 +102,17 @@ deps =
pylint
pylint-django
psycopg2-binary
django_webtest
faker
httmock
lxml
ldaptools
pytest
uwsgidecorators
pyquery
commands =
./getlasso3.sh
bash -c 'pylint -f parseable --rcfile pylint.rc src/authentic2_idp_cas src/authentic2_auth_oidc src/authentic2_idp_oidc src/authentic2_auth_saml src/authentic2 src/django_rbac src/authentic2_auth_fc | tee pylint.out'
./pylint.sh tests/ src/
[testenv:manage]
usedevelop = True