cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Misspelling of `build.rs` doesn't get reported

Open diondokter opened this issue 2 years ago • 1 comments

Problem

I was giving a workshop to people new to rust and in one of the exercises they were instructed to create a build.rs file. However, this person either didn't read this correctly or typo-ed and created builds.rs.

Obviously, (or rather very unobviously) this won't work and it took me and her about 5 minutes to figure out.

Proposed Solution

Cargo could try to see if there's no current build.rs yet and then if there's a file that's a likely misspelling of the name. If it finds that's the case it could output a warning with a suggestion to rename the file.

Notes

There could be false positives with this in theory. But that would be a pretty strange project layout, so I feel that would almost never happen.

diondokter avatar Nov 29 '23 13:11 diondokter

If we did this, we'd likely want it to be user controlled, blocking on #12235.

Whether we do this as part of cargo's regular operations or as part of an explicit lint step is TBD.

epage avatar Nov 29 '23 17:11 epage