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
6 This also adds cgcs_make_patch folder for pylint
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.
12 Change-Id: I0d7a87ed435ed716a3c1ea98f5d7badfd2adac7d
15 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
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
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
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
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
47 @@ -61,7 +69,7 @@ output-format=text
50 # Tells whether to display a full report or only the messages
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
58 index 0000000..ef4e838
60 +++ b/cgcs-patch/cgcs-patch/pylint_make_patch.rc
64 +# Specify a configuration file.
67 +# Python code to execute, usually for sys.path manipulation such as
71 +# Profiled execution.
74 +# Add files or directories to the blacklist. They should be base names, not
78 +# Pickle collected data for later comparisons.
81 +# List of plugins (as comma separated values of python modules names) to load,
82 +# usually to register additional checkers.
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.
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
108 +# The following are suppressed due to pylint warnings in cgcs_make_patch
109 +# fixme Use of fixme, todo, etc..
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,
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.
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]".
139 +# Tells whether to display a full report or only the messages
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
147 +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
149 +# Add a comment according to your evaluation note. This is used by the global
150 +# evaluation report (RP0004).
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
160 +# Required attributes for module, separated by a comma
161 +required-attributes=
163 +# List of builtins function names that should not be used, separated by a comma
164 +bad-functions=map,filter,apply,input,file
166 +# Good variable names which should always be accepted, separated by a comma
167 +good-names=i,j,k,ex,Run,_
169 +# Bad variable names which should always be refused, separated by a comma
170 +bad-names=foo,bar,baz,toto,tutu,tata
172 +# Colon-delimited sets of names that determine each other's naming style when
173 +# the name regexes allow several styles.
176 +# Include a hint for the correct naming format with invalid-name
177 +include-naming-hint=no
179 +# Regular expression matching correct function names
180 +function-rgx=[a-z_][a-z0-9_]{2,30}$
182 +# Naming hint for function names
183 +function-name-hint=[a-z_][a-z0-9_]{2,30}$
185 +# Regular expression matching correct variable names
186 +variable-rgx=[a-z_][a-z0-9_]{2,30}$
188 +# Naming hint for variable names
189 +variable-name-hint=[a-z_][a-z0-9_]{2,30}$
191 +# Regular expression matching correct constant names
192 +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
194 +# Naming hint for constant names
195 +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
197 +# Regular expression matching correct attribute names
198 +attr-rgx=[a-z_][a-z0-9_]{2,30}$
200 +# Naming hint for attribute names
201 +attr-name-hint=[a-z_][a-z0-9_]{2,30}$
203 +# Regular expression matching correct argument names
204 +argument-rgx=[a-z_][a-z0-9_]{2,30}$
206 +# Naming hint for argument names
207 +argument-name-hint=[a-z_][a-z0-9_]{2,30}$
209 +# Regular expression matching correct class attribute names
210 +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
212 +# Naming hint for class attribute names
213 +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
215 +# Regular expression matching correct inline iteration names
216 +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
218 +# Naming hint for inline iteration names
219 +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
221 +# Regular expression matching correct class names
222 +class-rgx=[A-Z_][a-zA-Z0-9]+$
224 +# Naming hint for class names
225 +class-name-hint=[A-Z_][a-zA-Z0-9]+$
227 +# Regular expression matching correct module names
228 +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
230 +# Naming hint for module names
231 +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
233 +# Regular expression matching correct method names
234 +method-rgx=[a-z_][a-z0-9_]{2,30}$
236 +# Naming hint for method names
237 +method-name-hint=[a-z_][a-z0-9_]{2,30}$
239 +# Regular expression which should only match function or class names that do
240 +# not require a docstring.
241 +no-docstring-rgx=__.*__
243 +# Minimum line length for functions/classes that require docstrings, shorter
245 +docstring-min-length=-1
250 +# Maximum number of characters on a single line.
253 +# Regexp for a line that is allowed to be longer than the limit.
254 +ignore-long-lines=^\s*(# )?<?https?://\S+>?$
256 +# Allow the body of an if to be on the same line as the test if there is no
258 +single-line-if-stmt=no
260 +# List of optional constructs for which whitespace checking is disabled
261 +no-space-check=trailing-comma,dict-separator
263 +# Maximum number of lines in a module
264 +max-module-lines=1000
266 +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
270 +# Number of spaces of indent required inside a hanging or continued line.
271 +indent-after-paren=4
276 +# Logging modules to check that the string format arguments are in logging
277 +# function parameter format
278 +logging-modules=logging
283 +# List of note tags to take in consideration, separated by a comma.
284 +notes=FIXME,XXX,TODO
289 +# Minimum lines number of a similarity.
290 +min-similarity-lines=4
292 +# Ignore comments when computing similarities.
295 +# Ignore docstrings when computing similarities.
296 +ignore-docstrings=yes
298 +# Ignore imports when computing similarities.
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
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
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
317 +# When zope mode is activated, add a predefined set of Zope acquired attributes
318 +# to generated-members.
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
329 +# Tells whether we should check for unused import in __init__ files.
332 +# A regular expression matching the name of dummy variables (i.e. expectedly
334 +dummy-variables-rgx=_$|dummy
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=
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
347 +# List of method names used to declare (i.e. assign) instance attributes.
348 +defining-attr-methods=__init__,__new__,setUp
350 +# List of valid names for the first argument in a class method.
351 +valid-classmethod-first-arg=cls
353 +# List of valid names for the first argument in a metaclass class method.
354 +valid-metaclass-classmethod-first-arg=mcs
359 +# Maximum number of arguments for function / method
362 +# Argument names that match this expression will be ignored. Default to name
363 +# with leading underscore
364 +ignored-argument-names=_.*
366 +# Maximum number of locals for function / method body
369 +# Maximum number of return / yield for function / method body
372 +# Maximum number of branch for function / method body
375 +# Maximum number of statements in function / method body
378 +# Maximum number of parents for a class (see R0901).
381 +# Maximum number of attributes for a class (see R0902).
384 +# Minimum number of public methods for a class (see R0903).
385 +min-public-methods=2
387 +# Maximum number of public methods for a class (see R0904).
388 +max-public-methods=20
393 +# Deprecated modules which should not be used, separated by a comma
394 +deprecated-modules=regsub,TERMIOS,Bastion,rexec
396 +# Create a graph of every (i.e. internal and external) dependencies in the
397 +# given file (report RP0402 must not be disabled)
400 +# Create a graph of external dependencies in the given file (report RP0402 must
404 +# Create a graph of internal dependencies in the given file (report RP0402 must
411 +# Exceptions that will emit a warning when being caught. Defaults to
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
426 @@ -85,13 +84,12 @@ commands =
430 +basepython = python3
431 deps = {[testenv]deps}
434 -basepython = python2.7
437 commands = pylint cgcs_patch --rcfile=./pylint.rc
438 + pylint cgcs_make_patch --rcfile=./pylint_make_patch.rc