Projet

Général

Profil

0001-misc-integrate-pylint.rc-in-repo-55505.patch

Lauréline Guérin, 12 juillet 2021 11:23

Télécharger (4,02 ko)

Voir les différences:

Subject: [PATCH 01/23] misc: integrate pylint.rc in repo (#55505)

 pylint.rc | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pylint.sh |  15 +------
 2 files changed, 119 insertions(+), 13 deletions(-)
 create mode 100644 pylint.rc
pylint.rc
1
[MASTER]
2
profile=no
3
persistent=yes
4
ignore=vendor,Bouncers,ezt.py
5
cache-size=500
6

  
7
[MESSAGES CONTROL]
8
disable=
9
    abstract-method,
10
    arguments-differ,
11
    attribute-defined-outside-init,
12
    bad-super-call,
13
    consider-using-set-comprehension,
14
    consider-using-ternary,
15
    cyclic-import,
16
    duplicate-code,
17
    exec-used,
18
    fixme,
19
    import-outside-toplevel,
20
    inconsistent-return-statements,
21
    invalid-name,
22
    invalid-str-returned,
23
    keyword-arg-before-vararg,
24
    missing-class-docstring,
25
    missing-function-docstring,
26
    missing-module-docstring,
27
    no-else-return,
28
    no-member,
29
    no-self-use,
30
    not-an-iterable,
31
    protected-access,
32
    raise-missing-from,
33
    redefined-argument-from-local,
34
    redefined-builtin,
35
    redefined-outer-name,
36
    superfluous-parens,
37
    too-many-ancestors,
38
    too-many-branches,
39
    too-many-instance-attributes,
40
    too-many-lines,
41
    too-many-locals,
42
    too-many-nested-blocks,
43
    too-many-return-statements,
44
    too-many-statements,
45
    undefined-loop-variable,
46
    unsubscriptable-object,
47
    unused-argument,
48
    use-a-generator
49

  
50

  
51
[REPORTS]
52
output-format=parseable
53
include-ids=yes
54

  
55

  
56
[BASIC]
57
no-docstring-rgx=__.*__|_.*
58
class-rgx=[A-Z_][a-zA-Z0-9_]+$
59
function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$
60
method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$
61
const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$
62
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
63

  
64
[TYPECHECK]
65

  
66
# Tells whether missing members accessed in mixin class should be ignored. A
67
# mixin class is detected if its name ends with "mixin" (case insensitive).
68
ignore-mixin-members=yes
69

  
70
# List of classes names for which member attributes should not be checked
71
# (useful for classes with attributes dynamically set).
72
ignored-classes=SQLObject,WSGIRequest,Publisher,NullSessionManager
73

  
74
# When zope mode is activated, add a predefined set of Zope acquired attributes
75
# to generated-members.
76
zope=no
77

  
78
# List of members which are set dynamically and missed by pylint inference
79
# system, and so shouldn't trigger E0201 when accessed.
80
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
81

  
82
# List of method names used to declare (i.e. assign) instance attributes
83
defining-attr-methods=__init__,__new__,setUp
84

  
85

  
86
[VARIABLES]
87
init-import=no
88
dummy-variables-rgx=_|dummy
89
additional-builtins=_,N_,ngettext
90
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
91

  
92
[SIMILARITIES]
93
min-similarity-lines=6
94
ignore-comments=yes
95
ignore-docstrings=yes
96

  
97

  
98
[MISCELLANEOUS]
99
notes=FIXME,XXX,TODO
100

  
101

  
102
[FORMAT]
103
max-line-length=160
104
max-module-lines=2000
105
indent-string='    '
106

  
107

  
108
[DESIGN]
109
max-args=10
110
max-locals=15
111
max-returns=6
112
max-branchs=12
113
max-statements=50
114
max-parents=7
115
max-attributes=7
116
min-public-methods=0
117
max-public-methods=50
pylint.sh
1
#!/bin/sh
2

  
1
#!/bin/bash
3 2
set -e -x
4 3
env
5
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
6
	PYLINT_RC=/var/lib/jenkins/pylint.django.rc
7
elif [ -f pylint.django.rc ]; then
8
	PYLINT_RC=pylint.django.rc
9
else
10
	echo No pylint RC found
11
	exit 0
12
fi
13 4

  
14
test -f pylint.out && cp pylint.out pylint.out.prev
15
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
16
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true
5
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out || /bin/true
17
-