Projet

Général

Profil

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

Lauréline Guérin, 30 août 2021 17:53

Télécharger (4,18 ko)

Voir les différences:

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

 pylint.rc | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pylint.sh |  14 ++----
 2 files changed, 131 insertions(+), 11 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
    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

  
61

  
62
[REPORTS]
63
output-format=parseable
64
include-ids=yes
65

  
66

  
67
[BASIC]
68
no-docstring-rgx=__.*__|_.*
69
class-rgx=[A-Z_][a-zA-Z0-9_]+$
70
function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$
71
method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$
72
const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$
73
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
74

  
75
[TYPECHECK]
76

  
77
# Tells whether missing members accessed in mixin class should be ignored. A
78
# mixin class is detected if its name ends with "mixin" (case insensitive).
79
ignore-mixin-members=yes
80

  
81
# List of classes names for which member attributes should not be checked
82
# (useful for classes with attributes dynamically set).
83
ignored-classes=SQLObject,WSGIRequest,Publisher,NullSessionManager
84

  
85
# When zope mode is activated, add a predefined set of Zope acquired attributes
86
# to generated-members.
87
zope=no
88

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

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

  
96

  
97
[VARIABLES]
98
init-import=no
99
dummy-variables-rgx=_|dummy
100
additional-builtins=_,N_,ngettext
101
good-names=_,i,j,k,e,x,Run,,setUp,tearDown,r,p,s,v,fd
102

  
103
[SIMILARITIES]
104
min-similarity-lines=6
105
ignore-comments=yes
106
ignore-docstrings=yes
107

  
108

  
109
[MISCELLANEOUS]
110
notes=FIXME,XXX,TODO
111

  
112

  
113
[FORMAT]
114
max-line-length=160
115
max-module-lines=2000
116
indent-string='    '
117

  
118

  
119
[DESIGN]
120
max-args=10
121
max-locals=15
122
max-returns=6
123
max-branchs=12
124
max-statements=50
125
max-parents=7
126
max-attributes=7
127
min-public-methods=0
128
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
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
4

  
5
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out || /bin/true
14
-