-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
tidy should not traverse untracked directories #69291
Comments
@pnkfelix Do you know which "part" of tidy is doing this? I suspect rustfmt myself, but am not quite sure :) Ideally we'd do a global audit I guess for using |
No, I don't know which part is doing it. I was assuming it was |
Well, I meant specifically what the errors were about -- I assume rustfmt based on your last message? i.e., these are not (for example) line length or license check warnings, right? |
Oh I see. I've only observed the problem with the I just did a quick test; it seems like only the Or at least, an untracked file with a long line does not seem to trigger the line length check. I'm not clear on how the current license check works; I skimmed the |
I spent a bit of time trying to look at this, but failed to quickly figure out how to get a list of files from git. AFAICT, It was my impression based on some searching online that this is perhaps even expected behavior. It's possible that we could do some sort of dual listing, where we both apply the current ignore rules, but also only visit files in that list. I also checked, and it's my impression that all of our checks would hit this problem -- rustfmt is just significantly more likely to do so. |
…mt-on-untracked-paths, r=Mark-Simulacrum Ignore untracked paths when running `rustfmt` on repository. This is a step towards resolving rust-lang#69291 (It might be the only step necessary at the moment; I'm not yet sure.)
This is true. (E.g. I just ran into it with untracked files that each had more than one trailing newine.) |
I suspect this was fixed by #106440. |
Ok, the current behavior is that tidy doesn't look at ignored files (i.e. files in The fix for this is probably to run rust/src/tools/tidy/src/walk.rs Lines 5 to 35 in 8af42f6
|
@rustbot claim |
Imo tidy should check untracked files. If I run tidy before committing code and then commit+push I'd get CI errors because tidy skipped those. |
Removing assignment due to #112921 (comment) |
assign it to me , i will look into it |
@NoobProgrammer31 Done 🙂 In future you can use rustbot to claim issues (see example above ) |
Totally agree. Being forced to stage files before running lint is annoying. Of course, there should be a flow here most developers are agreed on and once someone gets used to it, it would makes sense. I tried hard to think objective below:
|
I ran (effectively):
There are often extraneous files and directories in my source tree. And often they are not even files/directories that I had created (see (*) below).
The problem is that tidy does a blanket traversal of the tree under
src/
, as far as I can tell, and thus will happily flag "problems" in files that are no longer effectively part of the source code.(My most recent instance of this was tidy flagging a problem in a
.rs
file undersrc/stdsimd/
.)Eventually, after several rounds of trying to understand why non-tidy code got checked into the github repo, I'll eventually remember to look at
git status
and take note of the directories listed under untracked files. And then, usually, delete them.But this should not be necessary.
tidy
should be smart enough to rungit status
itself and use that to drive its traversal.(*) part of the above process is the build system will automatically update submodules. But old directories from old (outdated) submodule checkouts still stick around.
The text was updated successfully, but these errors were encountered: