summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2017-09-09 08:59:09 -0700
committerToshio Kuratomi <a.badger@gmail.com>2017-09-11 17:31:26 -0700
commit525c2a3e85af5ae2b821747fc5ea6629dc815c57 (patch)
tree753bbbcb99bbfeeb465249d57eef39aa31d25d70
parent404b02a1cbd279c04c073d35f2f487071b361440 (diff)
downloadansible-525c2a3e85af5ae2b821747fc5ea6629dc815c57.tar.gz
Expand disabled pylint rules. (#29162)
* Expand disabled pylint rules. * Fix pylint and unicode issues in ansible-test. (cherry picked from commit f88750d66512bb01fa64e9080f3d3fbc9eb9d758)
-rw-r--r--test/runner/lib/sanity/pylint.py2
-rw-r--r--test/runner/lib/test.py2
-rw-r--r--test/runner/lib/util.py3
-rw-r--r--test/sanity/pylint/disable.txt88
-rw-r--r--test/sanity/pylint/enable.txt1
5 files changed, 87 insertions, 9 deletions
diff --git a/test/runner/lib/sanity/pylint.py b/test/runner/lib/sanity/pylint.py
index d8659d230c..45347a09e3 100644
--- a/test/runner/lib/sanity/pylint.py
+++ b/test/runner/lib/sanity/pylint.py
@@ -89,7 +89,7 @@ class PylintTest(SanitySingleVersion):
messages = []
errors = [SanityMessage(
- message=m['message'],
+ message=m['message'].replace('\n', ' '),
path=m['path'],
line=int(m['line']),
column=int(m['column']),
diff --git a/test/runner/lib/test.py b/test/runner/lib/test.py
index 0e163a99f9..967f1d842b 100644
--- a/test/runner/lib/test.py
+++ b/test/runner/lib/test.py
@@ -359,7 +359,7 @@ class TestFailure(TestResult):
if self.summary:
block = self.summary
else:
- block = '\n'.join(str(m) for m in self.messages)
+ block = '\n'.join(m.format() for m in self.messages)
message = block.strip()
diff --git a/test/runner/lib/util.py b/test/runner/lib/util.py
index 8d58d4843c..20da394ede 100644
--- a/test/runner/lib/util.py
+++ b/test/runner/lib/util.py
@@ -374,6 +374,9 @@ class Display(object):
message = message.replace(self.clear, color)
message = '%s%s%s' % (color, message, self.clear)
+ if sys.version_info[0] == 2 and isinstance(message, type(u'')):
+ message = message.encode('utf-8')
+
print(message, file=fd)
fd.flush()
diff --git a/test/sanity/pylint/disable.txt b/test/sanity/pylint/disable.txt
index 87776ef524..8bc2fae97d 100644
--- a/test/sanity/pylint/disable.txt
+++ b/test/sanity/pylint/disable.txt
@@ -1,24 +1,100 @@
+abstract-method
access-member-before-definition
+anomalous-backslash-in-string
+anomalous-unicode-escape-in-string
+arguments-differ
assignment-from-no-return
-C
+attribute-defined-outside-init
+bad-continuation
+bad-format-string
+bad-indentation
+bad-mcs-classmethod-argument
+bad-open-mode
+bad-whitespace
+bare-except
+blacklisted-name
+broad-except
+cell-var-from-loop
+consider-iterating-dictionary
+consider-using-enumerate
+dangerous-default-value
+deprecated-method
+deprecated-module
+duplicate-key
+eval-used
+exec-used
+expression-not-assigned
+fixme
function-redefined
+global-at-module-level
+global-statement
+global-variable-not-assigned
+global-variable-undefined
import-error
+import-self
+invalid-name
+line-too-long
locally-disabled
-locally-enabled
+logging-format-interpolation
+logging-not-lazy
+lost-exception
method-hidden
+misplaced-comparison-constant
+missing-docstring
no-member
+no-name-in-module
+no-self-use
no-value-for-parameter
non-iterator-returned
-no-name-in-module
not-a-mapping
not-an-iterable
not-callable
-R
+pointless-statement
+pointless-string-statement
+protected-access
raising-bad-type
-raising-non-exception
+redefined-builtin
+redefined-outer-name
+redefined-variable-type
+redundant-unittest-assert
+reimported
+signature-differs
+simplifiable-if-statement
+super-init-not-called
+superfluous-parens
+suppressed-message
+too-few-public-methods
+too-many-ancestors
+too-many-arguments
+too-many-boolean-expressions
+too-many-branches
too-many-function-args
+too-many-instance-attributes
+too-many-lines
+too-many-locals
+too-many-nested-blocks
+too-many-public-methods
+too-many-return-statements
+too-many-statements
+trailing-newlines
+undefined-loop-variable
unexpected-keyword-arg
+ungrouped-imports
+unidiomatic-typecheck
+unnecessary-lambda
+unnecessary-pass
+unneeded-not
+unreachable
unsubscriptable-object
unsupported-membership-test
+unused-argument
+unused-import
+unused-variable
+unused-wildcard-import
used-before-assignment
-W
+useless-else-on-loop
+useless-suppression
+using-constant-test
+wildcard-import
+wrong-import-order
+wrong-import-position
diff --git a/test/sanity/pylint/enable.txt b/test/sanity/pylint/enable.txt
index 224cd8b175..e69de29bb2 100644
--- a/test/sanity/pylint/enable.txt
+++ b/test/sanity/pylint/enable.txt
@@ -1 +0,0 @@
-#wildcard-import