Skip to content

Commit d8f4560

Browse files
committed
Add a few more pre-commit checkers
1 parent d8bc536 commit d8f4560

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@ repos:
2323
- repo: https://github.com/pre-commit/pre-commit-hooks
2424
rev: v2.4.0
2525
hooks:
26+
- id: check-ast
27+
- id: check-docstring-first
28+
- id: check-executables-have-shebangs
29+
- id: check-merge-conflict
30+
- id: check-symlinks
31+
- id: debug-statements
2632
- id: trailing-whitespace
2733
- id: check-yaml
2834
- id: mixed-line-ending
2935
- id: name-tests-test
3036
args: ['--django']
3137
- id: check-json
38+
- id: requirements-txt-fixer
3239
- repo: https://github.com/codespell-project/codespell
3340
rev: v1.16.0
3441
hooks:
@@ -38,6 +45,10 @@ repos:
3845
rev: v0.0.3
3946
hooks:
4047
- id: taskcluster_yml
48+
- repo: https://github.com/asottile/yesqa
49+
rev: v0.0.11
50+
hooks:
51+
- id: yesqa
4152
- repo: meta
4253
hooks:
4354
- id: check-useless-excludes

backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-e ../tools #egg=code-coverage-tools
22
connexion==2.4.0
33
datadog==0.32.0
4+
fakeredis==1.1.0
45
Flask==1.1.1
56
Flask-Cors==3.0.8
67
flask-talisman==0.7.0
78
google-cloud-storage==1.23.0
89
gunicorn==20.0.4
910
python-dateutil==2.8.1
1011
pytoml==0.1.21
11-
fakeredis==1.1.0
1212
redis==3.3.11
1313
swagger-ui-bundle==0.0.6
1414
zstandard==0.12.0

bot/requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
jsonschema==3.2.0
21
json-e==3.0.0
2+
jsonschema==3.2.0
33
pre-commit==1.20.0
44
pytest==5.3.1
55
pytest-responses==0.4.0

bot/tests/test_taskcluster.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_get_task(
4242
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt",
4343
json=LATEST_LINUX,
4444
status=200,
45-
) # noqa
45+
)
4646
assert (
4747
taskcluster.get_task(
4848
"mozilla-central", "b2a9a4bb5c94de179ae7a3f52fde58c0e2897498", "linux"
@@ -55,7 +55,7 @@ def test_get_task(
5555
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.916103b8675d9fdb28b891cac235d74f9f475942.firefox.win64-ccov-debug",
5656
json=LATEST_WIN,
5757
status=200,
58-
) # noqa
58+
)
5959
assert (
6060
taskcluster.get_task(
6161
"mozilla-central", "916103b8675d9fdb28b891cac235d74f9f475942", "windows"
@@ -70,7 +70,7 @@ def test_get_task_not_found(mock_taskcluster, TASK_NOT_FOUND):
7070
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt",
7171
json=TASK_NOT_FOUND,
7272
status=404,
73-
) # noqa
73+
)
7474

7575
assert (
7676
taskcluster.get_task(
@@ -88,7 +88,7 @@ def test_get_task_failure(mock_taskcluster, TASK_NOT_FOUND):
8888
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt",
8989
json=err,
9090
status=500,
91-
) # noqa
91+
)
9292

9393
with pytest.raises(TaskclusterRestFailure, match="Indexed task not found"):
9494
taskcluster.get_task(
@@ -116,14 +116,14 @@ def test_get_tasks_in_group(mock_taskcluster, GROUP_TASKS_1, GROUP_TASKS_2):
116116
json=GROUP_TASKS_1,
117117
status=200,
118118
match_querystring=True,
119-
) # noqa
119+
)
120120
responses.add(
121121
responses.GET,
122122
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200", # noqa
123123
json=GROUP_TASKS_2,
124124
status=200,
125125
match_querystring=True,
126-
) # noqa
126+
)
127127

128128
assert (
129129
list(taskcluster.get_tasks_in_group("aPt9FbIdQwmhwDIPDYLuaw"))
@@ -265,7 +265,7 @@ def test_get_platform(task_name, expected):
265265
def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir):
266266
responses.add(
267267
responses.GET,
268-
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa
268+
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip",
269269
body="xml error...",
270270
status=403,
271271
)
@@ -287,7 +287,7 @@ def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir):
287287
def test_download_artifact_badzip(mocked_sleep, mock_taskcluster, tmpdir):
288288
responses.add(
289289
responses.GET,
290-
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa
290+
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip",
291291
body="NOT A ZIP FILE",
292292
status=200,
293293
stream=True,

tools/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
logbook
2-
structlog
3-
taskcluster==24.0.1
4-
raven
51

62
# limit async-timeout version to avoid using the alpha 4.0.0a0
73
async-timeout<4.0,>=3.0
4+
logbook
5+
raven
6+
structlog
7+
taskcluster==24.0.1

0 commit comments

Comments
 (0)