forked from fedora-copr/copr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pylintrc
154 lines (115 loc) · 4.74 KB
/
pylintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copr global pylint configuration.
[MASTER]
# Pickle collected data for later comparisons.
persistent=no
# Reasoning for ignored classes
# -----------------------------
# SQLAlchemy:
# Per https://github.com/PyCQA/pylint/issues/1973#issuecomment-418980111
# scoped_session:
# Same SQLAlchemy.
ignored-classes=SQLAlchemy,scoped_session
# Reasoning for ignored modules
# -----------------------------
# alembic:
# Pylint entirely fails to parse the module.
# Example error: Module 'alembic.op' has no 'drop_index' member
# setproctitle:
# https://github.com/dvarrazzo/py-setproctitle/issues/31
ignored-modules=alembic,setproctitle
init-hook=
import os
import subprocess
gitrootdir = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip()
sys.path.insert(0, os.path.join(gitrootdir, '.pylintpath'))
import copr_pylintrc
copr_pylintrc.init()
# Our own pylint transformations.
load-plugins=pylint_copr_plugin
[MESSAGES CONTROL]
# Reasoning for wide warning ignore
# ---------------------------------
# import-error
# This is to fix our Jenkins CI where we do not have all the build
# requirements for all our sub-components. We can afford not listening to
# this error because our packaging CI would discover the problems anyways.
# too-few-public-methods
# It's often useful to inherit from some (even library) class, and override
# some static property or even just constructor. This though makes PyLint
# warn us if parent method doesn't provide the minimal amount of methods,
# reported here: https://github.com/PyCQA/pylint/issues/4352
# It's inconvenient to silence this per-class.
# consider-using-f-string
# "style" warnings, usage of the f-strings is not yet approved by our team
# cyclic-import
# Seems like cyclic-import is just a style check which is not going to be
# fixed: https://github.com/PyCQA/pylint/issues/6983
disable=import-error,too-few-public-methods,consider-using-f-string,cyclic-import
[VARIABLES]
# A regular expression matching names used for dummy variables (i.e. not used).
# - "step_impl" is used for all the behave steps
dummy-variables-rgx=_|dummy|step_impl
[BASIC]
# Regular expression which should only match correct module names
# We ignore all
# - "copr-*" scripts (lowercase)
# - alembic migrations
# - fdec9947f8a1
# Default is: [a-z_][a-z0-9_]{2,30}$
module-rgx=(copr-[a-z-]*|[0-9a-f]{12}_[a-z_]+|[a-z_][a-z0-9_]{2,30})$
# Regular expression which should only match correct module level names
const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[a-zA-Z_][a-zA-Z0-9_]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-zA-Z0-9_]{,42}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-zA-Z0-9_]{,42}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-zA-Z0-9_]{,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-zA-Z0-9_]{,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-zA-Z0-9_]{,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Regular expression which should only match correct class sttribute names
class-attribute-rgx=id|([A-Za-z_][A-Za-z0-9_]{2,42}|(__.*__))$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
[DESIGN]
# Maximum number of arguments for function / method
max-args=10
# Maximum number of locals for function / method body
max-locals=20
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=20
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=1
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=
[SIMILARITIES]
# default is 4, which is pretty small
min-similarity-lines=8