Skip to content
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

run mypy even if ruff fails #203

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Conversation

masklinn
Copy link
Contributor

Because all the checks are performed in the same job and github actions will stop at the first step failure within a job, if one of the ruff checks (formatting or checking) fails then mypy does not run at all, which is undesirable.

Turns out the steps have an implicit if success() if no status check function (success, failure, always, cancelled) is used to guard the step.

Thus by gating on always and possibly explicitly checking the conclusion of specific checks it becomes possible to run mypy even though ruff check failed, but not run it if installing mypy failed.

Because all the checks are performed in the same job and github
actions will stop at the first step failure within a job, if one of
the ruff checks (formatting or checking) fails then mypy does not run
at all, which is undesirable.

Turns out the steps have an implicit `if success()` if no [status
check function][check] (`success`, `failure`, `always`, `cancelled`)
is used to guard the step.

Thus by gating on `always` and possibly explicitly checking the
conclusion of specific checks it becomes possible to run `mypy` even
though `ruff check` failed, but not run it if *installing* mypy
failed.

[check]: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
@masklinn masklinn enabled auto-merge (rebase) March 26, 2024 19:15
@masklinn masklinn merged commit a270fe2 into ua-parser:master Mar 26, 2024
29 checks passed
@masklinn masklinn deleted the independent-checkers branch March 26, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant