Fix E122,E126,E128 items in codebase

In the land of random cleanups, let more of the whitespace rules
back in. Also explicitly exclude E125 because of the overreach,
and leave E123 excluded because it creates some kind of odd
artifacts in the current code (possibly clean it up later).

Tox.ini adjusted with comments about the fact that what we are
ignoring is there for a reason.

Change-Id: I5636cb646d7898df71b715aa0e32a68ce279ee80
This commit is contained in:
Sean Dague 2013-11-30 10:40:34 -05:00
parent 3a8721bb51
commit a0be1593f5
4 changed files with 25 additions and 16 deletions

View File

@ -33,14 +33,14 @@ logging.basicConfig()
REQUIRED_FILES = [
'console.html',
'logs/screen-n-api.txt',
'logs/screen-n-cpu.txt',
'logs/screen-n-sch.txt',
'logs/screen-c-api.txt',
'logs/screen-c-vol.txt',
'logs/syslog.txt',
]
'console.html',
'logs/screen-n-api.txt',
'logs/screen-n-cpu.txt',
'logs/screen-n-sch.txt',
'logs/screen-c-api.txt',
'logs/screen-c-vol.txt',
'logs/syslog.txt',
]
class Stream(object):

View File

@ -42,8 +42,9 @@ class TestQueries(tests.TestCase):
for x in self.classifier.queries:
print("Looking for bug: https://bugs.launchpad.net/bugs/%s"
% x['bug'])
self.assertTrue((self._is_valid_ElasticSearch_query(x) or
self._is_valid_launchpad_bug(x['bug'])),
self.assertTrue(
(self._is_valid_ElasticSearch_query(x) or
self._is_valid_launchpad_bug(x['bug'])),
("Something is wrong with bug %s" % x['bug']))
def _is_valid_ElasticSearch_query(self, x):

View File

@ -77,16 +77,22 @@ class TestClassifier(tests.TestCase):
def test_is_ready(self):
self.stubs.Set(self.classifier.es, 'search', _fake_search)
result = self.classifier._is_ready('49282', '3', 'BLAH http://logs.'
'openstack.org/57/51057/1/gate/gate-tempest-devstack-vm-full'
'/f8965ee')
result = self.classifier._is_ready(
'49282',
'3',
'BLAH http://logs.openstack.org/57/51057/1/gate/'
'gate-tempest-devstack-vm-full/f8965ee'
)
self.assertTrue(result)
def test_classify(self):
self.stubs.Set(self.classifier.es, 'search', _fake_search)
self.stubs.Set(self.classifier, '_urls_match', _fake_urls_match)
self.stubs.Set(self.classifier, '_is_ready', _fake_is_ready)
bug_numbers = self.classifier.classify('47463', '3',
bug_numbers = self.classifier.classify(
'47463',
'3',
' blah http://logs.openstack.org/63/47463/3/gate/gate-tempest'
'-devstack-vm-postgres-full/99bb8f6')
'-devstack-vm-postgres-full/99bb8f6'
)
self.assertEqual(bug_numbers, [1234567])

View File

@ -29,6 +29,8 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
[flake8]
# H803 Skipped on purpose
# E125 Skipped because it's an overreach (and anti-emacs)
# E123 Skipped because it decreases clarity in many cases
ignore = E123,E122,E126,E128,H803
ignore = E123,E125,H803
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build