Skip to content
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

Misspelling of build.rs doesn't get reported #13073

Open
diondokter opened this issue Nov 29, 2023 · 1 comment
Open

Misspelling of build.rs doesn't get reported #13073

diondokter opened this issue Nov 29, 2023 · 1 comment
Labels
A-build-scripts Area: build.rs scripts A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@diondokter
Copy link

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 diondokter added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Nov 29, 2023
@epage epage added the A-build-scripts Area: build.rs scripts label Nov 29, 2023
@epage
Copy link
Contributor

epage commented Nov 29, 2023

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.

@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. A-diagnostics Area: Error and warning messages generated by Cargo itself. and removed S-triage Status: This issue is waiting on initial triage. labels Dec 4, 2023
@epage epage changed the title build.rs spelling doesn't get corrected Misspelling of build.rs doesn't get reported Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Area: build.rs scripts A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

3 participants