Projet

Général

Profil

0001-misc-update-pylint-configuration-56982.patch

Valentin Deniaud, 21 septembre 2021 17:09

Télécharger (5,63 ko)

Voir les différences:

Subject: [PATCH 01/59] misc: update pylint configuration (#56982)

 pylint.rc | 66 +++++++++++++++++++++++++++++++++++++++++++++++++------
 pylint.sh |  5 +++++
 tox.ini   | 16 +++-----------
 3 files changed, 67 insertions(+), 20 deletions(-)
 create mode 100755 pylint.sh
pylint.rc
1 1
[MASTER]
2 2
profile=no
3 3
persistent=yes
4
ignore=migrations
4
ignore=vendor,Bouncers,ezt.py
5 5
cache-size=500
6
load-plugins=pylint_django
7 6

  
8 7
[MESSAGES CONTROL]
9
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
8
disable=
9
    abstract-method,
10
    arguments-differ,
11
    assignment-from-none,
12
    attribute-defined-outside-init,
13
    bad-super-call,
14
    broad-except,
15
    consider-using-dict-comprehension,
16
    consider-using-set-comprehension,
17
    cyclic-import,
18
    duplicate-code,
19
    exec-used,
20
    fixme,
21
    global-variable-undefined,
22
    import-outside-toplevel,
23
    inconsistent-return-statements,
24
    invalid-name,
25
    keyword-arg-before-vararg,
26
    missing-class-docstring,
27
    missing-function-docstring,
28
    missing-module-docstring,
29
    no-else-return,
30
    no-member,
31
    no-self-use,
32
    non-parent-init-called,
33
    not-callable,
34
    possibly-unused-variable,
35
    protected-access,
36
    raise-missing-from,
37
    redefined-argument-from-local,
38
    redefined-builtin,
39
    redefined-outer-name,
40
    signature-differs,
41
    stop-iteration-return,
42
    super-init-not-called,
43
    superfluous-parens,
44
    too-many-ancestors,
45
    too-many-arguments,
46
    too-many-branches,
47
    too-many-instance-attributes,
48
    too-many-lines,
49
    too-many-locals,
50
    too-many-nested-blocks,
51
    too-many-return-statements,
52
    too-many-statements,
53
    undefined-loop-variable,
54
    unnecessary-comprehension,
55
    unspecified-encoding,
56
    unsubscriptable-object,
57
    unsupported-membership-test,
58
    unused-argument,
59
    use-a-generator,
60
    c-extension-no-member,
61
    consider-using-f-string
10 62

  
11 63

  
12 64
[REPORTS]
......
30 82

  
31 83
# List of classes names for which member attributes should not be checked
32 84
# (useful for classes with attributes dynamically set).
33
ignored-classes=
85
ignored-classes=SQLObject,WSGIRequest,Publisher,NullSessionManager
34 86

  
35 87
# When zope mode is activated, add a predefined set of Zope acquired attributes
36 88
# to generated-members.
......
38 90

  
39 91
# List of members which are set dynamically and missed by pylint inference
40 92
# system, and so shouldn't trigger E0201 when accessed.
41
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields
93
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
42 94

  
43 95
# List of method names used to declare (i.e. assign) instance attributes
44
defining-attr-methods=__init__,__new__
96
defining-attr-methods=__init__,__new__,setUp
45 97

  
46 98

  
47 99
[VARIABLES]
48 100
init-import=no
49 101
dummy-variables-rgx=_|dummy
50
good-names=_,i,j,k,fd
102
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
51 103

  
52 104
[SIMILARITIES]
53 105
min-similarity-lines=6
pylint.sh
1
#!/bin/bash
2
set -e -x
3
env
4

  
5
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0
tox.ini
66 66
  pytz
67 67
  pytest-freezegun
68 68
  faker
69
  pylint
70
  pylint-django
69 71
  enum34<=1.1.6
70 72
  ldaptools>=0.15
71 73
  oldldap: python-ldap<3
......
78 80
commands =
79 81
  ./getlasso3.sh
80 82
  rbac,authentic: py.test {env:PYTESTOPTIONS:} {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {env:JUNIT:} {env:SW:} {posargs:{env:TESTS} --random-group}
83
  pylint: ./pylint.sh tests/ src/
81 84

  
82 85
[testenv:check-migrations]
83 86
basepython = python3
......
91 94
  ./getlasso3.sh
92 95
  ./check-migrations.sh
93 96

  
94
[testenv:pylint]
95
basepython = python3
96
setenv =
97
  DJANGO_SETTINGS_MODULE=authentic2.settings
98
  SETUPTOOLS_USE_DISTUTILS=stdlib
99
deps =
100
    pylint
101
    pylint-django
102
    psycopg2-binary
103
commands =
104
    ./getlasso3.sh
105
    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'
106

  
107 97
[testenv:manage]
108 98
usedevelop = True
109 99
setenv =
110
-