Fixed flake8 and broken gate

Flake8 went broken recently, adopts correct calling method to avoid
regression and fixes broken rules.

Also removes openstack-tox-pep8 from gate which was a guaranteed
failure when triggered as pep8 was removed.

Change-Id: Iba03d3051952f461bb16299a6d32475b2be43041
This commit is contained in:
Sorin Sbarnea 2020-01-27 14:06:28 +00:00
parent 612dfbd118
commit b6611fd03a
6 changed files with 45 additions and 37 deletions

View File

@ -10,9 +10,12 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: flake8
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.9'
hooks:
- id: flake8
# commented to allow progressive adoption in smaller patches
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.18.0

View File

@ -340,22 +340,26 @@ if __name__ == '__main__':
formatter_class=argparse.RawTextHelpFormatter,
description='Get a dictionary of releases from a release '
'and a featureset file.')
parser.add_argument('--stable-release',
parser.add_argument(
'--stable-release',
choices=RELEASES,
required=True,
help='Release that the change being tested is from.\n'
'All other releases are calculated from this\n'
'basis.')
parser.add_argument('--featureset-file',
parser.add_argument(
'--featureset-file',
required=True,
help='Featureset file which will be introspected to\n'
'infer what type of upgrade is being performed\n'
'(if any).')
parser.add_argument('--output-file', default=default_output_file,
parser.add_argument(
'--output-file', default=default_output_file,
help='Output file containing dictionary of releases\n'
'for the provided featureset and release.\n'
'(default: %(default)s)')
parser.add_argument('--log-file', default=default_log_file,
parser.add_argument(
'--log-file', default=default_log_file,
help='log file to print debug information from\n'
'running the script.\n'
'(default: %(default)s)')

View File

@ -173,9 +173,9 @@ def gen_html(data, html_file, table_file, stats_hours, job_names, options):
fp.write("</tr>")
fp.write("<table>")
fp.write("<p>Query parameters:</p>")
fp.write("Branch: "+options.b+"<br/>")
fp.write("Status: "+options.s+"<br/>")
fp.write("Limit: "+options.l)
fp.write("Branch: " + options.b + "<br/>")
fp.write("Status: " + options.s + "<br/>")
fp.write("Limit: " + options.l)
total = passed_jobs + partial_jobs + failed_jobs
fp.write("<p>Overall</p>")
@ -245,8 +245,7 @@ def main(args=sys.argv[1:]):
'project': re.sub(r'.*/', '', review['project']),
'branch': review['branch'],
})
results[key].setdefault(
'ci_results', {}).update(ci_results)
results[key].setdefault('ci_results', {}).update(ci_results)
gen_html(results, opts.o, "%s-table" % opts.o, 24, job_names, opts)

View File

@ -33,3 +33,8 @@ warnerrors = False
[tool:pytest]
norecursedirs = .git .tox dist
log_cli = true
[flake8]
# based on https://github.com/psf/black
ignore = E203,E501,W503,W504,D
# "D" added because we do not use docstrings checks, yet

View File

@ -71,9 +71,6 @@
- openstack-tox-py35:
files:
- ^scripts/emit_releases_file/.*$
- openstack-tox-pep8:
files:
- ^scripts/emit_releases_file/.*$
- tripleo-buildimage-overcloud-full-centos-7:
files: *build_images_files
- tripleo-ci-centos-7-standalone-upgrade-train: