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
Fix singular and plural for "error(s)" #2157
Conversation
This is awesome. Will merge soon. I want to get the Windows compatibility PR in first. Then, I'm happy to help rebase this if there are any conflicts. |
Yeah I agree, nice changes! Since these are separate changes, I think merging by rebase would be in order. |
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
on: [push, pull_request, workflow_dispatch] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with this configuration is that it always results in duplicate CI runs for pull requests: once for the push
event in the head repository and once for the pull_request
event in the base repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's fine.
First, so contributors can see test results it on their forks first, to make sure it passes before proceeding; and then again for the base repo, so the test results can be seen by maintainers in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, this actually does seem non-ideal, since PRs in the main repo are now showing all the duplicate tasks. It'd be nice to at least get rid of those somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d recommend
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
and in the unusual case where a contributor wants to run CI on their fork before creating a pull request, workflow_dispatch
allows them to trigger it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
workflow_dispatch
is good for manual triggers, but as a contributor who wants to test my code on CI before opening PRs, the amount of clicks it requires to start each build is pretty tedious. And CI should be automatic not manual.
CIs are amazing things - you can automatically test and lint your code on all these different versions! We should encourage contributors to use them. But if they don't want to, that's fine, and GitHub Actions is normally disabled for forks.
As another approach, how does this config look?
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see the problem with having to open a PR to run the CI ... you can open the PR as a draft and mark it as ready once the CI has passed if you care about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason is to avoid noise on the tracker, for example, there may be lots of commits/rebases etc as things progress.
Another option is to follow the lead of things like pytest and pre-commit, and run the CI for branches prefixed with test-me-
:
on:
push:
branches: [main, test-me-*]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could open a PR in your own fork.
astral-sh#2157 (comment) Signed-off-by: Anders Kaseorg <andersk@mit.edu>
#2157 (comment) Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
writeln!( | ||
stdout, | ||
"Found {total} error(s) ({fixed} fixed, {remaining} remaining)." | ||
"Found {total} error{s}) ({fixed} fixed, {remaining} remaining)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.231` -> `^0.0.235` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.235/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.235/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.235/compatibility-slim/0.0.231)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.235/confidence-slim/0.0.231)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.235`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.235) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.234...v0.0.235) #### Summary Follow-up release to `v0.0.234` to fix two non-fatal issues related to CLI output. (No new rules or functionality.) #### What's Changed - Avoid duplicate CI runs triggered by pushes to pull requests by [@​andersk](https://togithub.com/andersk) in [astral-sh/ruff#2178 - Restore single-file license by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2180 - Windows compatibility by [@​sbrugman](https://togithub.com/sbrugman) in [astral-sh/ruff#2033 - Remove stray parenthesis from fixed errors message by [@​andersk](https://togithub.com/andersk) in [astral-sh/ruff#2181 - Fix conflicting error message warning by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2182 **Full Changelog**: astral-sh/ruff@v0.0.234...v0.0.235 ### [`v0.0.234`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.234) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.233...v0.0.234) #### What's Changed - Move is_overlong to helpers by [@​ericroberts](https://togithub.com/ericroberts) in [astral-sh/ruff#2137 - Update .pre-commit-config.yml by [@​JonathanPlasse](https://togithub.com/JonathanPlasse) in [astral-sh/ruff#2139 - Avoid generating dirty call paths by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2144 - Implement runtime-import-in-type-checking-block (TYP004) by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2146 - Implement typing-only import detection (TYP001, TYP002, TYP003) by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2147 - Add `#![warn(clippy::pedantic)]` to lib.rs and main.rs files by [@​not-my-profile](https://togithub.com/not-my-profile) in [astral-sh/ruff#2148 - Treat Python 3.7 as minimum supported version by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2159 - Avoid flagging unused loop variable (B007) with locals() by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2161 - Avoid prefer-type-error (TRY004) with intermediary control flow by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2162 - Add an FAQ on autofix by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2163 - Avoid re-resolving settings for repeated paths by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2165 - Suggest input format in error case by [@​spaceone](https://togithub.com/spaceone) in [astral-sh/ruff#2167 - Re-add error wrapper in main.rs by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2168 - fix: avoid flagging unused loop variable (B007) with globals(), vars() or eval() by [@​spaceone](https://togithub.com/spaceone) in [astral-sh/ruff#2166 - Fix singular and plural for "error(s)" by [@​hugovk](https://togithub.com/hugovk) in [astral-sh/ruff#2157 - Add Babel to readme by [@​akx](https://togithub.com/akx) in [astral-sh/ruff#2170 - Add flake8-builtins options to README by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2173 - Avoid reraise-no-cause for explicit reraises by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2174 - Rename TYP rules to TYC by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2175 - Actually, rename TYP rules to TCH by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2176 **Full Changelog**: astral-sh/ruff@v0.0.233...v0.0.234 ### [`v0.0.233`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.233) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.231...v0.0.233) This is a rerun of `v0.0.232` (unreleased) to address build failures on Windows. #### What's Changed - Move compare to helpers file by [@​ericroberts](https://togithub.com/ericroberts) in [astral-sh/ruff#2131 - Enable executable checks on Windows by [@​charliermarsh](https://togithub.com/charliermarsh) in [astral-sh/ruff#2133 **Full Changelog**: astral-sh/ruff@v0.0.232...v0.0.233 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTEuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExMS4xIn0=--> Signed-off-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Computers are really bad at some things, but one thing they're really good at is counting :)
So let's replace:
With:
Also some CI updates: