Skip to content

Commit b6d9560

Browse files
authored
Remove line length limitations and use the same flake8 and isort configuration as bugbug (#720)
Fixes #669
1 parent 6805ee8 commit b6d9560

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

.flake8

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[flake8]
2-
ignore = E203,W503
3-
max-line-length = 159
4-
exclude = .git,__pycache__
2+
ignore = E101, E111, E114, E115, E116, E117, E121, E122, E123, E124, E125, E126, E127, E128, E129, E131, E133, E2, E3, E5, E501, E701, E702, E703, E704, W1, W2, W3, W503, W504
3+
exclude = .git,__pycache__

.isort.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ known_first_party = code_coverage_backend,code_coverage_bot,code_coverage_events
33
known_third_party = connexion,datadog,dateutil,fakeredis,flask,flask_cors,flask_talisman,google,hglib,jsone,jsonschema,libmozdata,libmozevent,logbook,magic,pytest,pytz,raven,redis,requests,responses,setuptools,structlog,taskcluster,tenacity,tqdm,werkzeug,yaml,zstandard
44
force_single_line = True
55
default_section=FIRSTPARTY
6-
line_length=159
6+
line_length=88
7+
include_trailing_comma=True
8+
multi_line_output=3

bot/code_coverage_bot/trigger_missing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def trigger_task(task_group_id: str, revision: str) -> None:
4848
def trigger_missing(server_address: str, out_dir: str = ".") -> None:
4949
triggered_revisions_path = os.path.join(out_dir, "triggered_revisions.zst")
5050

51-
url = f"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.{secrets[secrets.APP_CHANNEL]}.cron.latest/artifacts/public/triggered_revisions.zst" # noqa
51+
url = f"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.{secrets[secrets.APP_CHANNEL]}.cron.latest/artifacts/public/triggered_revisions.zst"
5252
r = requests.head(url, allow_redirects=True)
5353
if r.status_code != 404:
5454
utils.download_file(url, triggered_revisions_path)

bot/tests/test_notifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ def test_notification(mock_secrets, mock_taskcluster, mock_phabricator, fake_hg_
7575
mail = notify_email(revision2, stack, changesets_coverage)
7676
assert (
7777
mail
78-
== """* [Commit [(b'M', b'file')]Differential Revision: https://phabricator.services.mozilla.com/D2](https://phabricator.services.mozilla.com/D2): 0 covered out of 6 added.\n""" # noqa
78+
== """* [Commit [(b'M', b'file')]Differential Revision: https://phabricator.services.mozilla.com/D2](https://phabricator.services.mozilla.com/D2): 0 covered out of 6 added.\n"""
7979
)

bot/tests/test_taskcluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_get_tasks_in_group(mock_taskcluster, GROUP_TASKS_1, GROUP_TASKS_2):
103103
)
104104
responses.add(
105105
responses.GET,
106-
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200", # noqa
106+
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200",
107107
json=GROUP_TASKS_2,
108108
status=200,
109109
match_querystring=True,
@@ -284,7 +284,7 @@ def test_download_artifact_forbidden(mock_taskcluster, tmpdir, mock_tenacity):
284284

285285
with pytest.raises(
286286
requests.exceptions.HTTPError,
287-
match="403 Client Error: Forbidden for url: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa
287+
match="403 Client Error: Forbidden for url: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip",
288288
):
289289
taskcluster.download_artifact(
290290
os.path.join(tmpdir.strpath, "windows_reftest-6_code-coverage-grcov.zip"),

bot/tests/test_trigger_missing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_trigger_from_scratch(
2222

2323
responses.add(
2424
responses.HEAD,
25-
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst", # noqa
25+
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst",
2626
status=404,
2727
)
2828

@@ -233,13 +233,13 @@ def test_trigger_from_preexisting(
233233

234234
responses.add(
235235
responses.HEAD,
236-
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst", # noqa
236+
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst",
237237
status=200,
238238
)
239239

240240
responses.add(
241241
responses.GET,
242-
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst", # noqa
242+
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.relman.code-coverage.production.cron.latest/artifacts/public/triggered_revisions.zst",
243243
status=200,
244244
body=zstandard.ZstdCompressor().compress(
245245
f"{revision2}\n{revision3}".encode("ascii")

0 commit comments

Comments
 (0)