Skip to content

Enforce coding & quotes PEP8 rules #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions backend/code_coverage_backend/backend/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
strict_transport_security_max_age=flask_talisman.talisman.ONE_YEAR_IN_SECS,
strict_transport_security_include_subdomains=True,
content_security_policy={
'default-src': '\'none\'',
'default-src': "'none'",
# unsafe-inline is needed for the Swagger UI
'script-src': '\'self\' \'unsafe-inline\'',
'style-src': '\'self\' \'unsafe-inline\'',
'img-src': '\'self\'',
'connect-src': '\'self\'',
'script-src': "'self' 'unsafe-inline'",
'style-src': "'self' 'unsafe-inline'",
'img-src': "'self'",
'connect-src': "'self'",
},
content_security_policy_report_uri=None,
content_security_policy_report_only=False,
Expand Down
2 changes: 2 additions & 0 deletions backend/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fakeredis==1.0.3
flake8==3.7.8
flake8-coding
flake8-isort==2.7.0
flake8-quotes
pytest==5.0.1
responses==0.10.6
2 changes: 1 addition & 1 deletion bot/code_coverage_bot/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get(self, platform=None, suite=None, chunk=None):
files = os.listdir(self.parent_dir)

if suite is not None and chunk is not None:
raise Exception('suite and chunk can\'t both have a value')
raise Exception("suite and chunk can't both have a value")

# Filter artifacts according to platform, suite and chunk.
filtered_files = []
Expand Down
2 changes: 1 addition & 1 deletion bot/code_coverage_bot/codecov.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,4 @@ def go(self):
elif self.repository == MOZILLA_CENTRAL_REPOSITORY:
self.go_from_trigger_mozilla_central()
else:
assert False, 'We shouldn\'t be here!'
assert False, "We shouldn't be here!"
2 changes: 1 addition & 1 deletion bot/code_coverage_bot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run_check(command, **kwargs):
assert isinstance(command, list)

if len(command) == 0:
raise RunException('Can\'t run an empty command.')
raise RunException("Can't run an empty command.")

_kwargs = dict(
stdin=subprocess.DEVNULL, # no interactions
Expand Down
2 changes: 2 additions & 0 deletions bot/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
flake8==3.7.8
flake8-coding
flake8-isort==2.7.0
flake8-quotes
jsonschema==3.0.1
json-e==3.0.0
pytest==5.0.1
Expand Down
2 changes: 1 addition & 1 deletion bot/tests/test_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def add_dir(files):
'linux_xpcshell-7_code-coverage-grcov.zip'
])

with pytest.raises(Exception, match='suite and chunk can\'t both have a value'):
with pytest.raises(Exception, match="suite and chunk can't both have a value"):
a.get(chunk='xpcshell-7', suite='mochitest')


Expand Down
6 changes: 3 additions & 3 deletions bot/tests/test_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
]


@pytest.mark.parametrize("payload", payloads)
@pytest.mark.parametrize('payload', payloads)
def test_hook_syntax(payload):
'''
Validate the Taskcluster hook syntax
'''
assert os.path.exists(HOOK)

with open(HOOK, "r") as f:
with open(HOOK, 'r') as f:
# Patch the hook as in the taskboot deployment
content = f.read()
content = content.replace('REVISION', 'deadbeef1234')
Expand All @@ -48,6 +48,6 @@ def test_hook_syntax(payload):
# Now parse it as json
hook_content = json.loads(content)

jsonschema.validate(instance=payload, schema=hook_content["triggerSchema"])
jsonschema.validate(instance=payload, schema=hook_content['triggerSchema'])

jsone.render(hook_content, context=payload)