diff --git a/backend/code_coverage_backend/backend/build.py b/backend/code_coverage_backend/backend/build.py index bf5d2ef00..72b438c00 100644 --- a/backend/code_coverage_backend/backend/build.py +++ b/backend/code_coverage_backend/backend/build.py @@ -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, diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt index 545fe67bb..d66ad3ac8 100644 --- a/backend/requirements-dev.txt +++ b/backend/requirements-dev.txt @@ -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 diff --git a/bot/code_coverage_bot/artifacts.py b/bot/code_coverage_bot/artifacts.py index dec737d14..8adb45867 100644 --- a/bot/code_coverage_bot/artifacts.py +++ b/bot/code_coverage_bot/artifacts.py @@ -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 = [] diff --git a/bot/code_coverage_bot/codecov.py b/bot/code_coverage_bot/codecov.py index bbdafc60f..f6259f9f5 100644 --- a/bot/code_coverage_bot/codecov.py +++ b/bot/code_coverage_bot/codecov.py @@ -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!" diff --git a/bot/code_coverage_bot/utils.py b/bot/code_coverage_bot/utils.py index f38c22d7e..e6ea0a894 100644 --- a/bot/code_coverage_bot/utils.py +++ b/bot/code_coverage_bot/utils.py @@ -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 diff --git a/bot/requirements-dev.txt b/bot/requirements-dev.txt index caaf01f0e..ea1ba9fd5 100644 --- a/bot/requirements-dev.txt +++ b/bot/requirements-dev.txt @@ -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 diff --git a/bot/tests/test_artifacts.py b/bot/tests/test_artifacts.py index 85cdc02cd..88ddf2d2d 100644 --- a/bot/tests/test_artifacts.py +++ b/bot/tests/test_artifacts.py @@ -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') diff --git a/bot/tests/test_hook.py b/bot/tests/test_hook.py index 49a77f588..78526d6b3 100644 --- a/bot/tests/test_hook.py +++ b/bot/tests/test_hook.py @@ -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') @@ -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)