-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Warn on // tidy-ignore-linelength
#130984
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
Comments
This fixes rust-lang#130984. Tidy now warns on seeing the typo "tidy-ignore-[CHECK]" instead of "ignore-tidy-[CHECK]".
I implemented this warning here, and it warns on any appearance of the text
where I inserted the line However, I still have a couple questions. Footnotes
|
That seems reasonable.
I think tidy is in general under-tested. It may be possible to slightly rework how the tidy ignore directives are handled to permit testing it against a provided string line without actually touching fs, but yeah. |
Fixes rust-lang#130984. Tidy now warns on seeing the typo "tidy-ignore-{CHECK}" (it's actually "ignore-tidy").
How about checking if the word "tidy" has |
I think that would make sense yes. I don't quite recall what tidy directives exist. I just mentioned the ignore-tidy vs tidy-ignore form because this form trips me up every time lol. |
This was more complicated than I expected (tidy doesn't really have anywhere central to collect all the valid directives), so I made an implementation that only knows about the "ignore-tidy-FOO" directives used in I've updated the PR #135421 with this change. |
…ozkan Make tidy warn on unrecognized directives This PR makes it so tidy warns on unrecognized directives, as recommended on [the discussion of rust-lang#130984](rust-lang#130984 (comment)). This is edited from the previous version of this PR, which only warned on "tidy-ignore" and no other tidy directive typos. Fixes rust-lang#130984. `@rustbot` label A-tidy C-enhancement
Rollup merge of rust-lang#135421 - cod10129:warn-tidy-ignore, r=onur-ozkan Make tidy warn on unrecognized directives This PR makes it so tidy warns on unrecognized directives, as recommended on [the discussion of rust-lang#130984](rust-lang#130984 (comment)). This is edited from the previous version of this PR, which only warned on "tidy-ignore" and no other tidy directive typos. Fixes rust-lang#130984. ``@rustbot`` label A-tidy C-enhancement
I've ran into this many times, where I tried to write
or other
tidy-ignore-*
tidy directives. But this is actually wrong and does nothing, since the actual syntax isIt might be helpful if tidy warns on seeing
// tidy-ignore-linelength
. It's not a big deal, just a minor papercut.The text was updated successfully, but these errors were encountered: