Projet

Général

Profil

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

Lauréline Guérin, 22 mars 2022 10:29

Télécharger (4,17 ko)

Voir les différences:

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

 pylint.rc | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pylint.sh |  15 ++-----
 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
extension-pkg-allow-list=lxml
7

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

  
60

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

  
65

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

  
74
[TYPECHECK]
75

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

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

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

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

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

  
95

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

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

  
107

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

  
111

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

  
117

  
118
[DESIGN]
119
max-args=10
120
max-locals=15
121
max-returns=6
122
max-branchs=12
123
max-statements=50
124
max-parents=7
125
max-attributes=7
126
min-public-methods=0
127
max-public-methods=50
pylint.sh
1
#!/bin/sh
1
#!/bin/bash
2
set -e -x
3
env
2 4

  
3
set -e
4
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
5
	PYLINT_RC=/var/lib/jenkins/pylint.django.rc
6
elif [ -f pylint.django.rc ]; then
7
	PYLINT_RC=pylint.django.rc
8
else
9
	echo No pylint RC found
10
	exit 0
11
fi
12
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
5
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out || /bin/true
13
-