Suppress pep8 warnings that are not fixed yet

The code has over 2000 warnings related to indentation and line length
Suppressing these warnings allow us to fix those warnings in manageable code chunks

In addition to suppressing many of the warnings, this submission fixes
 W191 indentation contains tabs
 W291 trailing whitespace
 W292 no newline at end of file
 W293 blank line contains whitespace
 W391 blank line at end of file
 W503 line break before binary operator

Change-Id: If40f73d7312aec574d8141ea1af2cc6f1b4b8a46
This commit is contained in:
Al Bailey 2018-06-15 13:00:36 -05:00
parent 37f3cabe55
commit b5c61d006c
18 changed files with 481 additions and 457 deletions

View File

@ -101,7 +101,10 @@ class Parser:
for line in cfgLines:
if "Histogram" in line:
if self.write or self.stored:
self.add(self.proc,self.total,self.timestamp,self.rollingCount)
self.add(self.proc,
self.total,
self.timestamp,
self.rollingCount)
self.write=True
self.proc=line.partition("Histogram: ")[2]
self.proc=("".join(self.proc.split())).rstrip(':')

View File

@ -39,8 +39,9 @@ def build_html_doc(build_dir, document_data):
six.print_(index_html, file=f)
for toc_entry in document_data['table_of_contents']:
toc_entry_data = yaml.load(open(DOC_SRC_DIR + '/' + toc_entry['link']
+ '.yaml'))
toc_entry_data = yaml.load(open(DOC_SRC_DIR + '/' +
toc_entry['link'] +
'.yaml'))
toc_entry_data['page_link'] = toc_entry['link']
page_content_template = j2_env.get_template('page_content.html')

View File

@ -1481,8 +1481,8 @@ class QueryAlarmsStep(strategy.StrategyStep):
nfvi_alarms = list()
for nfvi_alarm in response['result-data']:
if (self.strategy._alarm_restrictions ==
strategy.STRATEGY_ALARM_RESTRICTION_TYPES.RELAXED
and nfvi_alarm.mgmt_affecting == 'False'):
strategy.STRATEGY_ALARM_RESTRICTION_TYPES.RELAXED and
nfvi_alarm.mgmt_affecting == 'False'):
DLOG.warn("Ignoring non-management affecting alarm "
"%s - uuid %s due to relaxed alarm "
"strictness" % (nfvi_alarm.alarm_id,
@ -1566,8 +1566,8 @@ class WaitDataSyncStep(strategy.StrategyStep):
nfvi_alarms = list()
for nfvi_alarm in response['result-data']:
if (self.strategy._alarm_restrictions ==
strategy.STRATEGY_ALARM_RESTRICTION_TYPES.RELAXED
and nfvi_alarm.mgmt_affecting == 'False'):
strategy.STRATEGY_ALARM_RESTRICTION_TYPES.RELAXED and
nfvi_alarm.mgmt_affecting == 'False'):
DLOG.warn("Ignoring non-management affecting alarm "
"%s - uuid %s due to relaxed alarm "
"strictness" % (nfvi_alarm.alarm_id,

View File

@ -2,5 +2,3 @@
#
# SPDX-License-Identifier: Apache-2.0
#

View File

@ -2,4 +2,3 @@
#
# SPDX-License-Identifier: Apache-2.0
#

View File

@ -86,4 +86,3 @@ class APIDispatcher(object):
utils.set_request_forward_environ(req, self._remote_host,
self._remote_port)
return self.app

View File

@ -87,8 +87,8 @@ class DebugProxy(Application):
else:
body = ''
path = (environ.get('SCRIPT_NAME', '')
+ environ.get('PATH_INFO', ''))
path = (environ.get('SCRIPT_NAME', '') +
environ.get('PATH_INFO', ''))
path = urllib.quote(path)
if 'QUERY_STRING' in environ:
path += '?' + environ['QUERY_STRING']

View File

@ -2,5 +2,3 @@
#
# SPDX-License-Identifier: Apache-2.0
#

View File

@ -156,4 +156,3 @@ def display_histogram_data(name=None):
histogram = _find_histogram(name)
if histogram is not None:
histogram.display_data()

View File

@ -270,4 +270,3 @@ class Middleware(Application):
return response
response = req.get_response(self.application)
return self.process_response(response)

View File

@ -33,4 +33,3 @@ def get_monotonic_timestamp_in_ms():
raise OSError(errno_, os.strerror(errno_))
timestamp_ms = (t.tv_sec * 1e+3) + (t.tv_nsec * 1e-6)
return timestamp_ms

29
tox.ini
View File

@ -28,6 +28,35 @@ commands =
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint"
[pep8]
# Temporarily ignoring these warnings
# E101 indentation contains mixed spaces and tabs
# E116 unexpected indentation (comment)
# E121 continuation line under-indented for hanging indent
# E122 continuation line missing indentation or outdented
# E123 closing bracket does not match indentation of opening bracket
# E124 closing bracket does not match visual indentation
# E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E129 visually indented line with same indent as next logical line
# E203 whitespace before ':'
# E211 whitespace before '('
# E225 missing whitespace around operator
# E226 missing whitespace around arithmetic operator
# E228 missing whitespace around modulo operator
# E231 missing whitespace after ':'
# E241 multiple spaces after
# E261 at least two spaces before inline comment
# E265 block comment should start with '# '
# E251 unexpected spaces around keyword / parameter equals
# E302 expected 2 blank lines, found 1
# E303 too many blank lines
# E501 line too long
# E712 comparison to bool should be reworded
ignore = E101,E116,E121,E123,E122,E124,E126,E127,E128,E129,E203,E211,E225,E226,E228,E231,E241,E251,E261,E265,E302,E303,E501,E712
[testenv:pep8]
usedevelop = False
skip_install = True