Repository navigation
Tidy should not check line lengths in UI tests #77548
Copy link
Copy link
Closed
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Description
UI tests regularly have long lines due to the //~ ERROR annotations. So it is not very helpful for tidy to complain about overly long lines... every single time that happened, I ended up adding // ignore-tidy-linelength (the amount of time it took me to figure out the exact way to do this went down from 3-5min the first time to <20s by now). To make test maintenance even more annoying, when an error message changes to become shorter, tidy will complain about the ignore flag being unnecessary! And each time the flag is added or removed, you need to re-bless the tests as line numbers change.
This chore doesn't really seem worth it. We don't rustfmt the test suite either. Can we just disable the line length checker in the test suite please?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Activity
Mark-Simulacrum commentedon Oct 4, 2020
We can add a check similar to https://github.com/rust-lang/rust/blob/master/src/tools/tidy/src/style.rs#L171 to disable just the line length limits for UI tests.
Anthuang commentedon Oct 7, 2020
Hey, first time contributor here happy to give this a shot! I think I get what's going on here, but do you have any pointers for where I should be looking exactly?
Mark-Simulacrum commentedon Oct 7, 2020
I would add a "in_tests" check similar to the the under_rustfmt one here
rust/src/tools/tidy/src/style.rs
Line 171 in 8ae3b50
rust/src/tools/tidy/src/style.rs
Line 229 in 8ae3b50
Rollup merge of rust-lang#77675 - Anthuang:tidy-line-length, r=Mark-S…
Rollup merge of rust-lang#77675 - Anthuang:tidy-line-length, r=Mark-S…
sjakobi commentedon Mar 26, 2021
Is the plan suggested in #77675 (comment) still good?
RalfJung commentedon Mar 26, 2021
@sjakobi yeah I'd say it is. #77675 actually did most of the work (adjusting tidy); someone just has to do the multi-stage landing process:
Step 3 is assuming that we truly want to keep that check. I personally think it is somewhat silly, but I assume it was added because people want it, so maybe we should keep it.
sjakobi commentedon Mar 27, 2021
@rustbot claim
tidy: Add ignore-rules for the line length check
Auto merge of rust-lang#83549 - sjakobi:no-tidy-line-length-1, r=Mark…
Remove redundant `ignore-tidy-linelength` annotations
Rollup merge of rust-lang#83807 - sjakobi:77548-remove-ignore-annotat…
Rollup merge of rust-lang#83807 - sjakobi:77548-remove-ignore-annotat…
tidy: Re-enable the "ignoring file length unnecessarily" check
Auto merge of rust-lang#84100 - sjakobi:77548-reenable-check, r=jyn514
RalfJung commentedon Apr 12, 2021
@sjakobi thank you so much for pushing this through. :-)
sjakobi commentedon Apr 12, 2021
@RalfJung Thanks to your quick advice and @Anthuang's great preparatory work this was in fact pretty easy. I'm very impressed by the tooling and automation surrounding the contribution process! 💪