Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-update / files / 0003-Cleaning-up-pylint-settings-for-cgcs-patch.patch
1 From de774c85653692b2a901123b5653d0e2101c5353 Mon Sep 17 00:00:00 2001
2 From: Al Bailey <Al.Bailey@windriver.com>
3 Date: Fri, 4 Oct 2019 12:29:03 -0500
4 Subject: [PATCH] Cleaning up pylint settings for cgcs patch
5
6 This also adds cgcs_make_patch folder for  pylint
7
8 pylint is invoked with two different pylint.rc files
9 so that different codes can be suppressed for the
10 two different code structures.
11
12 Change-Id: I0d7a87ed435ed716a3c1ea98f5d7badfd2adac7d
13 Story: 2004515
14 Task: 37701
15 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
16
17 ---
18  cgcs-patch/cgcs-patch/pylint.rc            |  14 +-
19  cgcs-patch/cgcs-patch/pylint_make_patch.rc | 352 +++++++++++++++++++++++++++++
20  cgcs-patch/cgcs-patch/tox.ini              |   6 +-
21  3 files changed, 365 insertions(+), 7 deletions(-)
22  create mode 100644 cgcs-patch/cgcs-patch/pylint_make_patch.rc
23
24 diff --git a/cgcs-patch/cgcs-patch/pylint.rc b/cgcs-patch/cgcs-patch/pylint.rc
25 index dc20bb0..812b6b5 100644
26 --- a/cgcs-patch/cgcs-patch/pylint.rc
27 +++ b/cgcs-patch/cgcs-patch/pylint.rc
28 @@ -44,8 +44,16 @@ symbols=no
29  # --enable=similarities". If you want to run only the classes checker, but have
30  # no Warning level messages displayed, use"--disable=all --enable=classes
31  # --disable=W"
32 -#disable=
33 -disable=C, R, W0603, W0613, W0702, W0703, W1201
34 +# E1111 assignment-from-no-return
35 +# W0107 unnecessary-pass
36 +# W0603 global-statement
37 +# W0612 unused-variable
38 +# W0613 unused-argument
39 +# W0703 broad-except
40 +# W0705 duplicate-except
41 +# W1201 logging-not-lazy
42 +# W1505, deprecated-method
43 +disable=C, R, E1111, W0107, W0603, W0612, W0613, W0703, W0705, W1201, W1505
44  
45  
46  [REPORTS]
47 @@ -61,7 +69,7 @@ output-format=text
48  files-output=no
49  
50  # Tells whether to display a full report or only the messages
51 -reports=yes
52 +reports=no
53  
54  # Python expression which should return a note less than 10 (10 is the highest
55  # note). You have access to the variables errors warning, statement which
56 diff --git a/cgcs-patch/cgcs-patch/pylint_make_patch.rc b/cgcs-patch/cgcs-patch/pylint_make_patch.rc
57 new file mode 100644
58 index 0000000..ef4e838
59 --- /dev/null
60 +++ b/cgcs-patch/cgcs-patch/pylint_make_patch.rc
61 @@ -0,0 +1,352 @@
62 +[MASTER]
63 +
64 +# Specify a configuration file.
65 +#rcfile=
66 +
67 +# Python code to execute, usually for sys.path manipulation such as
68 +# pygtk.require().
69 +#init-hook=
70 +
71 +# Profiled execution.
72 +profile=no
73 +
74 +# Add files or directories to the blacklist. They should be base names, not
75 +# paths.
76 +ignore=CVS
77 +
78 +# Pickle collected data for later comparisons.
79 +persistent=yes
80 +
81 +# List of plugins (as comma separated values of python modules names) to load,
82 +# usually to register additional checkers.
83 +load-plugins=
84 +
85 +# DEPRECATED
86 +include-ids=no
87 +
88 +# DEPRECATED
89 +symbols=no
90 +
91 +
92 +[MESSAGES CONTROL]
93 +
94 +# Enable the message, report, category or checker with the given id(s). You can
95 +# either give multiple identifier separated by comma (,) or put this option
96 +# multiple time. See also the "--disable" option for examples.
97 +#enable=
98 +
99 +# Disable the message, report, category or checker with the given id(s). You
100 +# can either give multiple identifiers separated by comma (,) or put this
101 +# option multiple times (only on the command line, not in the configuration
102 +# file where it should appear only once).You can also use "--disable=all" to
103 +# disable everything first and then reenable specific checks. For example, if
104 +# you want to run only the similarities checker, you can use "--disable=all
105 +# --enable=similarities". If you want to run only the classes checker, but have
106 +# no Warning level messages displayed, use"--disable=all --enable=classes
107 +# --disable=W"
108 +# The following are suppressed due to pylint warnings in cgcs_make_patch
109 +# fixme Use of fixme, todo, etc..
110 +# E1101 no-member
111 +# W0101 unreachable
112 +# W0104 pointless-statement
113 +# W0107 unnecessary-pass
114 +# W0212 protected-access
115 +# W0231 super-init-not-called
116 +# W0603 global-statement
117 +# W0612 unused-variable
118 +# W0613 unused-argument
119 +# W0622 redefined-builtin
120 +# W0703 broad-except
121 +# W1401 anomalous-backslash-in-string
122 +# W1505, deprecated-method
123 +disable=C, R, fixme, E1101,
124 +        W0101, W0104, W0107, W0212, W0231, W0603, W0612, W0613, W0622, W0703,
125 +        W1401, W1505
126 +
127 +[REPORTS]
128 +
129 +# Set the output format. Available formats are text, parseable, colorized, msvs
130 +# (visual studio) and html. You can also give a reporter class, eg
131 +# mypackage.mymodule.MyReporterClass.
132 +output-format=text
133 +
134 +# Put messages in a separate file for each module / package specified on the
135 +# command line instead of printing them on stdout. Reports (if any) will be
136 +# written in a file name "pylint_global.[txt|html]".
137 +files-output=no
138 +
139 +# Tells whether to display a full report or only the messages
140 +reports=no
141 +
142 +# Python expression which should return a note less than 10 (10 is the highest
143 +# note). You have access to the variables errors warning, statement which
144 +# respectively contain the number of errors / warnings messages and the total
145 +# number of statements analyzed. This is used by the global evaluation report
146 +# (RP0004).
147 +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
148 +
149 +# Add a comment according to your evaluation note. This is used by the global
150 +# evaluation report (RP0004).
151 +comment=no
152 +
153 +# Template used to display messages. This is a python new-style format string
154 +# used to format the message information. See doc for all details
155 +#msg-template=
156 +
157 +
158 +[BASIC]
159 +
160 +# Required attributes for module, separated by a comma
161 +required-attributes=
162 +
163 +# List of builtins function names that should not be used, separated by a comma
164 +bad-functions=map,filter,apply,input,file
165 +
166 +# Good variable names which should always be accepted, separated by a comma
167 +good-names=i,j,k,ex,Run,_
168 +
169 +# Bad variable names which should always be refused, separated by a comma
170 +bad-names=foo,bar,baz,toto,tutu,tata
171 +
172 +# Colon-delimited sets of names that determine each other's naming style when
173 +# the name regexes allow several styles.
174 +name-group=
175 +
176 +# Include a hint for the correct naming format with invalid-name
177 +include-naming-hint=no
178 +
179 +# Regular expression matching correct function names
180 +function-rgx=[a-z_][a-z0-9_]{2,30}$
181 +
182 +# Naming hint for function names
183 +function-name-hint=[a-z_][a-z0-9_]{2,30}$
184 +
185 +# Regular expression matching correct variable names
186 +variable-rgx=[a-z_][a-z0-9_]{2,30}$
187 +
188 +# Naming hint for variable names
189 +variable-name-hint=[a-z_][a-z0-9_]{2,30}$
190 +
191 +# Regular expression matching correct constant names
192 +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
193 +
194 +# Naming hint for constant names
195 +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
196 +
197 +# Regular expression matching correct attribute names
198 +attr-rgx=[a-z_][a-z0-9_]{2,30}$
199 +
200 +# Naming hint for attribute names
201 +attr-name-hint=[a-z_][a-z0-9_]{2,30}$
202 +
203 +# Regular expression matching correct argument names
204 +argument-rgx=[a-z_][a-z0-9_]{2,30}$
205 +
206 +# Naming hint for argument names
207 +argument-name-hint=[a-z_][a-z0-9_]{2,30}$
208 +
209 +# Regular expression matching correct class attribute names
210 +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
211 +
212 +# Naming hint for class attribute names
213 +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
214 +
215 +# Regular expression matching correct inline iteration names
216 +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
217 +
218 +# Naming hint for inline iteration names
219 +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
220 +
221 +# Regular expression matching correct class names
222 +class-rgx=[A-Z_][a-zA-Z0-9]+$
223 +
224 +# Naming hint for class names
225 +class-name-hint=[A-Z_][a-zA-Z0-9]+$
226 +
227 +# Regular expression matching correct module names
228 +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
229 +
230 +# Naming hint for module names
231 +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
232 +
233 +# Regular expression matching correct method names
234 +method-rgx=[a-z_][a-z0-9_]{2,30}$
235 +
236 +# Naming hint for method names
237 +method-name-hint=[a-z_][a-z0-9_]{2,30}$
238 +
239 +# Regular expression which should only match function or class names that do
240 +# not require a docstring.
241 +no-docstring-rgx=__.*__
242 +
243 +# Minimum line length for functions/classes that require docstrings, shorter
244 +# ones are exempt.
245 +docstring-min-length=-1
246 +
247 +
248 +[FORMAT]
249 +
250 +# Maximum number of characters on a single line.
251 +max-line-length=80
252 +
253 +# Regexp for a line that is allowed to be longer than the limit.
254 +ignore-long-lines=^\s*(# )?<?https?://\S+>?$
255 +
256 +# Allow the body of an if to be on the same line as the test if there is no
257 +# else.
258 +single-line-if-stmt=no
259 +
260 +# List of optional constructs for which whitespace checking is disabled
261 +no-space-check=trailing-comma,dict-separator
262 +
263 +# Maximum number of lines in a module
264 +max-module-lines=1000
265 +
266 +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
267 +# tab).
268 +indent-string='    '
269 +
270 +# Number of spaces of indent required inside a hanging or continued line.
271 +indent-after-paren=4
272 +
273 +
274 +[LOGGING]
275 +
276 +# Logging modules to check that the string format arguments are in logging
277 +# function parameter format
278 +logging-modules=logging
279 +
280 +
281 +[MISCELLANEOUS]
282 +
283 +# List of note tags to take in consideration, separated by a comma.
284 +notes=FIXME,XXX,TODO
285 +
286 +
287 +[SIMILARITIES]
288 +
289 +# Minimum lines number of a similarity.
290 +min-similarity-lines=4
291 +
292 +# Ignore comments when computing similarities.
293 +ignore-comments=yes
294 +
295 +# Ignore docstrings when computing similarities.
296 +ignore-docstrings=yes
297 +
298 +# Ignore imports when computing similarities.
299 +ignore-imports=no
300 +
301 +
302 +[TYPECHECK]
303 +
304 +# Tells whether missing members accessed in mixin class should be ignored. A
305 +# mixin class is detected if its name ends with "mixin" (case insensitive).
306 +ignore-mixin-members=yes
307 +
308 +# List of module names for which member attributes should not be checked
309 +# (useful for modules/projects where namespaces are manipulated during runtime
310 +# and thus existing member attributes cannot be deduced by static analysis
311 +ignored-modules=
312 +
313 +# List of classes names for which member attributes should not be checked
314 +# (useful for classes with attributes dynamically set).
315 +ignored-classes=rpm,PKCS1_PSS
316 +
317 +# When zope mode is activated, add a predefined set of Zope acquired attributes
318 +# to generated-members.
319 +zope=no
320 +
321 +# List of members which are set dynamically and missed by pylint inference
322 +# system, and so shouldn't trigger E0201 when accessed. Python regular
323 +# expressions are accepted.
324 +generated-members=REQUEST,acl_users,aq_parent
325 +
326 +
327 +[VARIABLES]
328 +
329 +# Tells whether we should check for unused import in __init__ files.
330 +init-import=no
331 +
332 +# A regular expression matching the name of dummy variables (i.e. expectedly
333 +# not used).
334 +dummy-variables-rgx=_$|dummy
335 +
336 +# List of additional names supposed to be defined in builtins. Remember that
337 +# you should avoid to define new builtins when possible.
338 +additional-builtins=
339 +
340 +
341 +[CLASSES]
342 +
343 +# List of interface methods to ignore, separated by a comma. This is used for
344 +# instance to not check methods defines in Zope's Interface base class.
345 +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
346 +
347 +# List of method names used to declare (i.e. assign) instance attributes.
348 +defining-attr-methods=__init__,__new__,setUp
349 +
350 +# List of valid names for the first argument in a class method.
351 +valid-classmethod-first-arg=cls
352 +
353 +# List of valid names for the first argument in a metaclass class method.
354 +valid-metaclass-classmethod-first-arg=mcs
355 +
356 +
357 +[DESIGN]
358 +
359 +# Maximum number of arguments for function / method
360 +max-args=5
361 +
362 +# Argument names that match this expression will be ignored. Default to name
363 +# with leading underscore
364 +ignored-argument-names=_.*
365 +
366 +# Maximum number of locals for function / method body
367 +max-locals=15
368 +
369 +# Maximum number of return / yield for function / method body
370 +max-returns=6
371 +
372 +# Maximum number of branch for function / method body
373 +max-branches=12
374 +
375 +# Maximum number of statements in function / method body
376 +max-statements=50
377 +
378 +# Maximum number of parents for a class (see R0901).
379 +max-parents=7
380 +
381 +# Maximum number of attributes for a class (see R0902).
382 +max-attributes=7
383 +
384 +# Minimum number of public methods for a class (see R0903).
385 +min-public-methods=2
386 +
387 +# Maximum number of public methods for a class (see R0904).
388 +max-public-methods=20
389 +
390 +
391 +[IMPORTS]
392 +
393 +# Deprecated modules which should not be used, separated by a comma
394 +deprecated-modules=regsub,TERMIOS,Bastion,rexec
395 +
396 +# Create a graph of every (i.e. internal and external) dependencies in the
397 +# given file (report RP0402 must not be disabled)
398 +import-graph=
399 +
400 +# Create a graph of external dependencies in the given file (report RP0402 must
401 +# not be disabled)
402 +ext-import-graph=
403 +
404 +# Create a graph of internal dependencies in the given file (report RP0402 must
405 +# not be disabled)
406 +int-import-graph=
407 +
408 +
409 +[EXCEPTIONS]
410 +
411 +# Exceptions that will emit a warning when being caught. Defaults to
412 +# "Exception"
413 +overgeneral-exceptions=Exception
414 diff --git a/cgcs-patch/cgcs-patch/tox.ini b/cgcs-patch/cgcs-patch/tox.ini
415 index ba9c568..88e5723 100644
416 --- a/cgcs-patch/cgcs-patch/tox.ini
417 +++ b/cgcs-patch/cgcs-patch/tox.ini
418 @@ -76,7 +76,6 @@ exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
419  enable-extensions = H106 H203 H904
420  max-line-length = 120
421  
422 -
423  [testenv:flake8]
424  basepython = python3
425  usedevelop = False
426 @@ -85,13 +84,12 @@ commands =
427      flake8 {posargs} .
428  
429  [testenv:pylint]
430 +basepython = python3
431  deps = {[testenv]deps}
432         pylint
433 -
434 -basepython = python2.7
435  sitepackages = False
436 -
437  commands = pylint cgcs_patch --rcfile=./pylint.rc
438 +           pylint cgcs_make_patch --rcfile=./pylint_make_patch.rc
439  
440  [testenv:cover]
441  setenv =