-
Notifications
You must be signed in to change notification settings - Fork 13.6k
setup typos check in CI #134006
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
setup typos check in CI #134006
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
Some changes occurred in exhaustiveness checking cc @Nadrieril Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval Some changes occurred in match checking cc @Nadrieril This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
f01ec3c
to
5b7daa7
Compare
This comment has been minimized.
This comment has been minimized.
The Miri subtree was changed cc @rust-lang/miri |
@@ -795,7 +795,7 @@ impl<'a> Parser<'a> { | |||
// When there are a few keywords in the last ten elements of `self.expected_tokens` and the current | |||
// token is an identifier, it's probably a misspelled keyword. | |||
// This handles code like `async Move {}`, misspelled `if` in match guard, misspelled `else` in `if`-`else` | |||
// and mispelled `where` in a where clause. | |||
// and misspelled `where` in a where clause. |
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.
they misspelled "misspelled" 😀
//! Note 2: this only applies to matcheable values. For example a value of type `Rc<u64>` can't be | ||
//! Note 2: this only applies to matchable values. For example a value of type `Rc<u64>` can't be |
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.
Didn't you add an exception for this in typos.toml
? I don't know which is correct but if there's an exception this should be kept, presumably.
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.
reverted
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.
Doesn't seem to be reverted. ;)
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.
Here #134006 (comment) reviewer said that this is not valid word, so i removed exception somewhere here 199e4e7.
I seem to recall a previous attempt at having typo-checks in CI that had a ton of false positives, this is much nicer, thanks. I can't approve the CI addition myself (does this require an FCP maybe?), but I looked through the typo fixes and they all look good to me. |
This comment has been minimized.
This comment has been minimized.
maybe an MCP? |
# Add exclusions here, lines should be like `x = "x"`, where `x` is excluded word. | ||
# | ||
# Also see docs: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md |
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.
Based on the documentation these aren't exclusions, they're custom additions to the dictionary.
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, but it is one of the ways to silence linter, so i wrote as exclusions
, to simplify wording.
Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake |
☔ The latest upstream changes (presumably #142974) made this pull request unmergeable. Please resolve the merge conflicts. |
Squashed previous commits and added review commit + commit where required version of typos checked.
Yes, run by default by separate job and will not immediately stop any other jobs in case if spellcheck fails.
Nope, running
Yes, and and can fix typos if |
Looks good! Squash the final two commits into the first commit and r=me. Thanks. @bors delegate=klensy |
✌️ @klensy, you can now approve this pull request! If @nnethercote told you to " |
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: rust-lang/compiler-team#817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
Rollup of 6 pull requests Successful merges: - #134006 (setup typos check in CI) - #142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - #143038 (avoid suggesting traits from private dependencies) - #143083 (Fix rustdoc not correctly showing attributes on re-exports) - #143283 (document optional jobs) - #143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - #143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #134006 - klensy:typos, r=nnethercote setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: rust-lang/compiler-team#817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
Rollup of 6 pull requests Successful merges: - rust-lang/rust#134006 (setup typos check in CI) - rust-lang/rust#142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - rust-lang/rust#143038 (avoid suggesting traits from private dependencies) - rust-lang/rust#143083 (Fix rustdoc not correctly showing attributes on re-exports) - rust-lang/rust#143283 (document optional jobs) - rust-lang/rust#143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - rust-lang/rust#134006 (setup typos check in CI) - rust-lang/rust#142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - rust-lang/rust#143038 (avoid suggesting traits from private dependencies) - rust-lang/rust#143083 (Fix rustdoc not correctly showing attributes on re-exports) - rust-lang/rust#143283 (document optional jobs) - rust-lang/rust#143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: rust-lang/compiler-team#817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
FYI: This PR integrated typo checking into CI incorrectly by merely adding a new workflow job instead of properly integrating it into our merge CI. This caused the tree to break (#t-infra > Spellcheck workflow now fails on all PRs (tree bad?)) because a PR with a typo was merged after this PR was merged. This is something our CI is designed to prevent via the no rocket science rule, but that only works when the jobs run on merge CI as intended. Any changes to CI should always go through the infra team to help prevent such mistakes. |
Sorry for the bustage! Judging by this comment there was some infra team awareness, and the sub-optimal config was similar to how tidy had worked in the past, which explains why it wasn't flagged as a problem. I.e. the situation was a bit complicated. |
You're right, as pointed out in the Zulip thread later this is actually more standard than I imagined, which surprised me :D |
Sounds like work is underway to tighten things up, so maybe we'll have a happy outcome :) |
Enforce that PR CI jobs are a subset of Auto CI jobs modulo carve-outs ### Background Currently, it is possible for a PR with red PR-only CI to pass Auto CI, then all subsequent PR CI runs will be red until that is fixed, even in completely unrelated PRs. For instance, this happened with PR-CI-only Spellcheck (#144183). See more discussions at [#t-infra > Spellcheck workflow now fails on all PRs (tree bad?)](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Spellcheck.20workflow.20now.20fails.20on.20all.20PRs.20.28tree.20bad.3F.29/with/529769404). ### CI invariant: PR CI jobs are a subset of Auto CI jobs modulo carve-outs To prevent red PR CI in completely unrelated subsequent PRs and PR CI runs, we need to maintain an invariant that **PR CI jobs are a subset of Auto CI jobs modulo carve-outs**. This is **not** a "strict" subset relationship: some jobs necessarily have to differ under PR CI and Auto CI environments, at least in the current setup. Still, we can try to enforce a weaker "subset modulo carve-outs" relationship between CI jobs and their corresponding Auto jobs. For instance: - `x86_64-gnu-tools` will have `auto`-only env vars like `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`. - `tidy` will want to `continue_on_error: true` in PR CI to allow for more "useful" compilation errors to also be reported, whereas it should be `continue_on_error: false` in Auto CI to prevent wasting Auto CI resources. The **carve-outs** are: 1. `env` variables. 2. `continue_on_error`. We enforce this invariant through `citool`, so only affects job definitions that are handled by `citool`. Notably, this is not sufficient *alone* to address the CI-only Spellcheck issue (#144183). To carry out this enforcement, we modify `citool` to auto-register PR jobs as Auto jobs with `continue_on_error` overridden to `false` **unless** there's an overriding Auto job for the PR job of the same name that only differs by the permitted **carve-outs**. ### Addressing the Spellcheck PR-only CI issue Note that Spellcheck currently does not go through `citool` or `bootstrap`, and is its own GitHub Actions workflow. To actually address the PR-CI-only Spellcheck issue (#144183), and carry out the subset-modulo-carve-outs enforcement universally, this PR additionally **removes the current Spellcheck implementation** (a separate GitHub Actions Workflow). That is incompatible with Homu unless we do some hacks in the main CI workflow. This effectively partially reverts #134006 (the separate workflow part, not the tidy extra checks component), but is not prejudice against relanding the `typos`-based spellcheck in another implementation that goes through the usual bootstrap CI workflow so that it does work with Homu. The `typos`-based spellcheck seems to have a good false-positive rate. Closes #144183. --- r? infra-ci
Enforce that PR CI jobs are a subset of Auto CI jobs modulo carve-outs ### Background Currently, it is possible for a PR with red PR-only CI to pass Auto CI, then all subsequent PR CI runs will be red until that is fixed, even in completely unrelated PRs. For instance, this happened with PR-CI-only Spellcheck (rust-lang/rust#144183). See more discussions at [#t-infra > Spellcheck workflow now fails on all PRs (tree bad?)](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Spellcheck.20workflow.20now.20fails.20on.20all.20PRs.20.28tree.20bad.3F.29/with/529769404). ### CI invariant: PR CI jobs are a subset of Auto CI jobs modulo carve-outs To prevent red PR CI in completely unrelated subsequent PRs and PR CI runs, we need to maintain an invariant that **PR CI jobs are a subset of Auto CI jobs modulo carve-outs**. This is **not** a "strict" subset relationship: some jobs necessarily have to differ under PR CI and Auto CI environments, at least in the current setup. Still, we can try to enforce a weaker "subset modulo carve-outs" relationship between CI jobs and their corresponding Auto jobs. For instance: - `x86_64-gnu-tools` will have `auto`-only env vars like `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`. - `tidy` will want to `continue_on_error: true` in PR CI to allow for more "useful" compilation errors to also be reported, whereas it should be `continue_on_error: false` in Auto CI to prevent wasting Auto CI resources. The **carve-outs** are: 1. `env` variables. 2. `continue_on_error`. We enforce this invariant through `citool`, so only affects job definitions that are handled by `citool`. Notably, this is not sufficient *alone* to address the CI-only Spellcheck issue (rust-lang/rust#144183). To carry out this enforcement, we modify `citool` to auto-register PR jobs as Auto jobs with `continue_on_error` overridden to `false` **unless** there's an overriding Auto job for the PR job of the same name that only differs by the permitted **carve-outs**. ### Addressing the Spellcheck PR-only CI issue Note that Spellcheck currently does not go through `citool` or `bootstrap`, and is its own GitHub Actions workflow. To actually address the PR-CI-only Spellcheck issue (rust-lang/rust#144183), and carry out the subset-modulo-carve-outs enforcement universally, this PR additionally **removes the current Spellcheck implementation** (a separate GitHub Actions Workflow). That is incompatible with Homu unless we do some hacks in the main CI workflow. This effectively partially reverts rust-lang/rust#134006 (the separate workflow part, not the tidy extra checks component), but is not prejudice against relanding the `typos`-based spellcheck in another implementation that goes through the usual bootstrap CI workflow so that it does work with Homu. The `typos`-based spellcheck seems to have a good false-positive rate. Closes rust-lang/rust#144183. --- r? infra-ci
This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying?
Also includes commits with actual typo fixes.
MCP: rust-lang/compiler-team#817
typos check currently turned for:
After merging, PRs which enables checks for other crates (tools) can be implemented too.
Found typos will not break other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr.
Check typos:
python x.py test tidy --extra-checks=spellcheck
Apply typo fixes:
python x.py test tidy --extra-checks=spellcheck:fix
(in case if there only 1 suggestion of each typo)Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.