Skip to content

Remove line length limitations and use the same flake8 and isort conf… #720

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

Merged
Merged
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
5 changes: 2 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[flake8]
ignore = E203,W503
max-line-length = 159
exclude = .git,__pycache__
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
exclude = .git,__pycache__
4 changes: 3 additions & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ known_first_party = code_coverage_backend,code_coverage_bot,code_coverage_events
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
force_single_line = True
default_section=FIRSTPARTY
line_length=159
line_length=88
include_trailing_comma=True
multi_line_output=3
2 changes: 1 addition & 1 deletion bot/code_coverage_bot/trigger_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def trigger_task(task_group_id: str, revision: str) -> None:
def trigger_missing(server_address: str, out_dir: str = ".") -> None:
triggered_revisions_path = os.path.join(out_dir, "triggered_revisions.zst")

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
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"
r = requests.head(url, allow_redirects=True)
if r.status_code != 404:
utils.download_file(url, triggered_revisions_path)
Expand Down
2 changes: 1 addition & 1 deletion bot/tests/test_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ def test_notification(mock_secrets, mock_taskcluster, mock_phabricator, fake_hg_
mail = notify_email(revision2, stack, changesets_coverage)
assert (
mail
== """* [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
== """* [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"""
)
4 changes: 2 additions & 2 deletions bot/tests/test_taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_get_tasks_in_group(mock_taskcluster, GROUP_TASKS_1, GROUP_TASKS_2):
)
responses.add(
responses.GET,
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200", # noqa
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200",
json=GROUP_TASKS_2,
status=200,
match_querystring=True,
Expand Down Expand Up @@ -284,7 +284,7 @@ def test_download_artifact_forbidden(mock_taskcluster, tmpdir, mock_tenacity):

with pytest.raises(
requests.exceptions.HTTPError,
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
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",
):
taskcluster.download_artifact(
os.path.join(tmpdir.strpath, "windows_reftest-6_code-coverage-grcov.zip"),
Expand Down
6 changes: 3 additions & 3 deletions bot/tests/test_trigger_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_trigger_from_scratch(

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

Expand Down Expand Up @@ -233,13 +233,13 @@ def test_trigger_from_preexisting(

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

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