Skip to content

Add a few more pre-commit checkers #322

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 2 commits into from
Dec 12, 2019
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
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
- id: trailing-whitespace
- id: check-yaml
- id: mixed-line-ending
- id: name-tests-test
args: ['--django']
- id: check-json
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v1.16.0
hooks:
Expand All @@ -38,6 +45,10 @@ repos:
rev: v0.0.3
hooks:
- id: taskcluster_yml
- repo: https://github.com/asottile/yesqa
rev: v0.0.11
hooks:
- id: yesqa
- repo: meta
hooks:
- id: check-useless-excludes
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-e ../tools #egg=code-coverage-tools
connexion==2.4.0
datadog==0.32.0
fakeredis==1.1.0
Flask==1.1.1
Flask-Cors==3.0.8
flask-talisman==0.7.0
google-cloud-storage==1.23.0
gunicorn==20.0.4
python-dateutil==2.8.1
pytoml==0.1.21
fakeredis==1.1.0
redis==3.3.11
swagger-ui-bundle==0.0.6
zstandard==0.12.0
2 changes: 1 addition & 1 deletion bot/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jsonschema==3.2.0
json-e==3.0.0
jsonschema==3.2.0
pre-commit==1.20.0
pytest==5.3.1
pytest-responses==0.4.0
Expand Down
16 changes: 8 additions & 8 deletions bot/tests/test_taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_get_task(
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt",
json=LATEST_LINUX,
status=200,
) # noqa
)
assert (
taskcluster.get_task(
"mozilla-central", "b2a9a4bb5c94de179ae7a3f52fde58c0e2897498", "linux"
Expand All @@ -55,7 +55,7 @@ def test_get_task(
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.916103b8675d9fdb28b891cac235d74f9f475942.firefox.win64-ccov-debug",
json=LATEST_WIN,
status=200,
) # noqa
)
assert (
taskcluster.get_task(
"mozilla-central", "916103b8675d9fdb28b891cac235d74f9f475942", "windows"
Expand All @@ -70,7 +70,7 @@ def test_get_task_not_found(mock_taskcluster, TASK_NOT_FOUND):
"http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt",
json=TASK_NOT_FOUND,
status=404,
) # noqa
)

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

with pytest.raises(TaskclusterRestFailure, match="Indexed task not found"):
taskcluster.get_task(
Expand Down Expand Up @@ -116,14 +116,14 @@ def test_get_tasks_in_group(mock_taskcluster, GROUP_TASKS_1, GROUP_TASKS_2):
json=GROUP_TASKS_1,
status=200,
match_querystring=True,
) # noqa
)
responses.add(
responses.GET,
"http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200", # noqa
json=GROUP_TASKS_2,
status=200,
match_querystring=True,
) # noqa
)

assert (
list(taskcluster.get_tasks_in_group("aPt9FbIdQwmhwDIPDYLuaw"))
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_get_platform(task_name, expected):
def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir):
responses.add(
responses.GET,
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip",
body="xml error...",
status=403,
)
Expand All @@ -287,7 +287,7 @@ def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir):
def test_download_artifact_badzip(mocked_sleep, mock_taskcluster, tmpdir):
responses.add(
responses.GET,
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa
"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip",
body="NOT A ZIP FILE",
status=200,
stream=True,
Expand Down
Empty file modified frontend/src/base.html
100755 → 100644
Empty file.
7 changes: 3 additions & 4 deletions tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# limit async-timeout version to avoid using the alpha 4.0.0a0
async-timeout<4.0,>=3.0
logbook
raven
structlog
taskcluster==24.1.0
raven

# limit async-timeout version to avoid using the alpha 4.0.0a0
async-timeout<4.0,>=3.0