From 4378355164b50119315c7876457fc510f2c0f2c1 Mon Sep 17 00:00:00 2001 From: Sergey Nikitin Date: Fri, 18 Sep 2020 11:52:52 +0400 Subject: [PATCH] Update hacking Change-Id: Id7a40b422eaa2874b1e1402c12f28a2fa4f45daa --- stackalytics/dashboard/web.py | 1 + stackalytics/processor/utils.py | 1 + stackalytics/tests/api/test_api.py | 58 +++++++++++++++--------------- test-requirements.txt | 2 +- tox.ini | 2 +- 5 files changed, 33 insertions(+), 31 deletions(-) diff --git a/stackalytics/dashboard/web.py b/stackalytics/dashboard/web.py index 31431f168..4d6db9d5d 100644 --- a/stackalytics/dashboard/web.py +++ b/stackalytics/dashboard/web.py @@ -724,5 +724,6 @@ def main(): app.run(CONF.listen_host, CONF.listen_port) + if __name__ == '__main__': main() diff --git a/stackalytics/processor/utils.py b/stackalytics/processor/utils.py index 21fd08a3f..ae55b6faf 100644 --- a/stackalytics/processor/utils.py +++ b/stackalytics/processor/utils.py @@ -312,6 +312,7 @@ def make_module_group(module_group_id, name=None, modules=None, tag='module'): 'modules': modules or {module_group_id}, 'tag': tag} + BAD_NAME_SUFFIXES = ['Ltd', 'Pvt', 'Inc', 'GmbH', 'AG', 'Corporation', 'Corp', 'Company', 'Co', 'Group', 'Srl', 'Limited', 'LLC', 'IT'] diff --git a/stackalytics/tests/api/test_api.py b/stackalytics/tests/api/test_api.py index 907fd4ffc..8b97161ce 100644 --- a/stackalytics/tests/api/test_api.py +++ b/stackalytics/tests/api/test_api.py @@ -98,38 +98,38 @@ class TestStorage(runtime_storage.RuntimeStorage): def _generate_commits(): - commit = { - 'commit_id': uuidutils.generate_uuid(), - 'lines_added': 9, 'module': 'nova', 'record_type': 'commit', - 'message': 'Closes bug 1212953\n\nChange-Id: ' - 'I33f0f37b6460dc494abf2520dc109c9893ace9e6\n', - 'subject': 'Fixed affiliation of Edgar and Sumit', 'loc': 10, - 'user_id': 'john_doe', - 'primary_key': uuidutils.generate_uuid(), - 'author_email': 'john_doe@ibm.com', 'company_name': 'IBM', - 'lines_deleted': 1, 'week': 2275, - 'blueprint_id': None, 'bug_id': u'1212953', - 'files_changed': 1, 'author_name': u'John Doe', - 'date': 1376737923, 'launchpad_id': u'john_doe', - 'branches': set([u'master']), - 'change_id': u'I33f0f37b6460dc494abf2520dc109c9893ace9e6', - 'release': u'icehouse' - } - yield commit + commit = { + 'commit_id': uuidutils.generate_uuid(), + 'lines_added': 9, 'module': 'nova', 'record_type': 'commit', + 'message': 'Closes bug 1212953\n\nChange-Id: ' + 'I33f0f37b6460dc494abf2520dc109c9893ace9e6\n', + 'subject': 'Fixed affiliation of Edgar and Sumit', 'loc': 10, + 'user_id': 'john_doe', + 'primary_key': uuidutils.generate_uuid(), + 'author_email': 'john_doe@ibm.com', 'company_name': 'IBM', + 'lines_deleted': 1, 'week': 2275, + 'blueprint_id': None, 'bug_id': u'1212953', + 'files_changed': 1, 'author_name': u'John Doe', + 'date': 1376737923, 'launchpad_id': u'john_doe', + 'branches': set([u'master']), + 'change_id': u'I33f0f37b6460dc494abf2520dc109c9893ace9e6', + 'release': u'icehouse' + } + yield commit def _generate_marks(): - mark = { - 'launchpad_id': 'john_doe', 'week': 2294, 'user_id': 'john_doe', - 'description': 'Approved', 'author_name': 'John Doe', - 'author_email': 'john_doe@gmail.com', - 'primary_key': uuidutils.generate_uuid() + 'Workflow', - 'module': 'glance', 'patch': 2, 'record_type': 'mark', - 'company_name': '*independent', 'branch': 'master', - 'date': 1387860458, 'record_id': 37184, 'release': 'icehouse', - 'value': 1, 'type': 'Workflow', - 'review_id': uuidutils.generate_uuid()} - yield mark + mark = { + 'launchpad_id': 'john_doe', 'week': 2294, 'user_id': 'john_doe', + 'description': 'Approved', 'author_name': 'John Doe', + 'author_email': 'john_doe@gmail.com', + 'primary_key': uuidutils.generate_uuid() + 'Workflow', + 'module': 'glance', 'patch': 2, 'record_type': 'mark', + 'company_name': '*independent', 'branch': 'master', + 'date': 1387860458, 'record_id': 37184, 'release': 'icehouse', + 'value': 1, 'type': 'Workflow', + 'review_id': uuidutils.generate_uuid()} + yield mark def _generate_review(): diff --git a/test-requirements.txt b/test-requirements.txt index 1cd386be1..a25b901dd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=3.1.0,<3.2.0 # Apache-2.0 coverage>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0,<4.0 # BSD diff --git a/tox.ini b/tox.ini index 56db97b76..d7f4e62ae 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ commands = python setup.py build_sphinx [flake8] # E123, E125 skipped as they are invalid PEP-8 -ignore = +ignore = W605, W503, W504, E731 show-source = true builtins = _ exclude=.venv*,.git,.tox,dist,doc,*lib/python*,*egg,tools,build