Clean up ansible-test pylint configs. (#70129)

* Sort disabled pylint codes in config.
* Fix comments in pylint config.
* Add comments to pylint config.
* Prepare to sort pylint config.
* Fix pylint config indentation.
* Sort pylint good/bad names in config.
* Add changelog fragment.
This commit is contained in:
Matt Clay 2020-06-17 15:06:04 -07:00 committed by GitHub
parent fa1fb2d13b
commit e3f3b4002e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 64 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Reorganize internal ``pylint`` configuration files for easier comparison and maintenance.

View file

@ -1,8 +1,11 @@
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable= disable=
consider-using-dict-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-set-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
cyclic-import, # consistent results require running with --jobs 1 and testing all files cyclic-import, # consistent results require running with --jobs 1 and testing all files
duplicate-code, # consistent results require running with --jobs 1 and testing all files duplicate-code, # consistent results require running with --jobs 1 and testing all files
no-self-use,
too-few-public-methods, too-few-public-methods,
too-many-arguments, too-many-arguments,
too-many-branches, too-many-branches,
@ -12,28 +15,27 @@ disable=
too-many-nested-blocks, too-many-nested-blocks,
too-many-return-statements, too-many-return-statements,
too-many-statements, too-many-statements,
no-self-use,
unused-import, # pylint does not understand PEP 484 type hints unused-import, # pylint does not understand PEP 484 type hints
consider-using-dict-comprehension, # requires Python 2.6, which we still support
consider-using-set-comprehension, # requires Python 2.6, which we still support
[BASIC] [BASIC]
bad-names=foo, bad-names=
bar, _,
baz, bar,
toto, baz,
tutu, foo,
tata, tata,
_, toto,
tutu,
good-names=i, good-names=
j, __metaclass__,
k, C,
ex, ex,
Run, i,
C, j,
__metaclass__, k,
Run,
method-rgx=[a-z_][a-z0-9_]{2,40}$ method-rgx=[a-z_][a-z0-9_]{2,40}$
function-rgx=[a-z_][a-z0-9_]{2,40}$ function-rgx=[a-z_][a-z0-9_]{2,40}$

View file

@ -17,11 +17,11 @@ disable=
comparison-with-callable, comparison-with-callable,
consider-iterating-dictionary, consider-iterating-dictionary,
consider-merging-isinstance, consider-merging-isinstance,
consider-using-dict-comprehension, consider-using-dict-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-enumerate, consider-using-enumerate,
consider-using-get, consider-using-get,
consider-using-in, consider-using-in,
consider-using-set-comprehension, consider-using-set-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-ternary, consider-using-ternary,
cyclic-import, # consistent results require running with --jobs 1 and testing all files cyclic-import, # consistent results require running with --jobs 1 and testing all files
deprecated-lambda, deprecated-lambda,
@ -115,19 +115,21 @@ disable=
[BASIC] [BASIC]
bad-names=foo, bad-names=
bar, _,
baz, bar,
toto, baz,
tutu, foo,
tata, tata,
_, toto,
tutu,
good-names=i, good-names=
j, ex,
k, i,
ex, j,
Run, k,
Run,
[TYPECHECK] [TYPECHECK]

View file

@ -17,11 +17,11 @@ disable=
comparison-with-callable, comparison-with-callable,
consider-iterating-dictionary, consider-iterating-dictionary,
consider-merging-isinstance, consider-merging-isinstance,
consider-using-dict-comprehension, consider-using-dict-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-enumerate, consider-using-enumerate,
consider-using-get, consider-using-get,
consider-using-in, consider-using-in,
consider-using-set-comprehension, consider-using-set-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-ternary, consider-using-ternary,
cyclic-import, # consistent results require running with --jobs 1 and testing all files cyclic-import, # consistent results require running with --jobs 1 and testing all files
deprecated-lambda, deprecated-lambda,
@ -115,19 +115,21 @@ disable=
[BASIC] [BASIC]
bad-names=foo, bad-names=
bar, _,
baz, bar,
toto, baz,
tutu, foo,
tata, tata,
_, toto,
tutu,
good-names=i, good-names=
j, ex,
k, i,
ex, j,
Run, k,
Run,
[TYPECHECK] [TYPECHECK]

View file

@ -1,8 +1,11 @@
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable= disable=
consider-using-dict-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
consider-using-set-comprehension, # requires Python 2.7+, but we still require Python 2.6 support
cyclic-import, # consistent results require running with --jobs 1 and testing all files cyclic-import, # consistent results require running with --jobs 1 and testing all files
duplicate-code, # consistent results require running with --jobs 1 and testing all files duplicate-code, # consistent results require running with --jobs 1 and testing all files
missing-docstring,
too-few-public-methods, too-few-public-methods,
too-many-arguments, too-many-arguments,
too-many-branches, too-many-branches,
@ -12,30 +15,29 @@ disable=
too-many-nested-blocks, too-many-nested-blocks,
too-many-return-statements, too-many-return-statements,
too-many-statements, too-many-statements,
missing-docstring,
unused-import, # pylint does not understand PEP 484 type hints unused-import, # pylint does not understand PEP 484 type hints
consider-using-dict-comprehension, # requires Python 2.6, which we still support
consider-using-set-comprehension, # requires Python 2.6, which we still support
[BASIC] [BASIC]
bad-names=foo, bad-names=
bar, _,
baz, bar,
toto, baz,
tutu, foo,
tata, tata,
_, toto,
tutu,
good-names=i, good-names=
j, __metaclass__,
k, C,
f, e,
e, ex,
ex, f,
Run, i,
C, j,
__metaclass__, k,
Run,
module-rgx=[a-z_][a-z0-9_-]{2,40}$ module-rgx=[a-z_][a-z0-9_-]{2,40}$
method-rgx=[a-z_][a-z0-9_]{2,40}$ method-rgx=[a-z_][a-z0-9_]{2,40}$