-
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
Don't lint snake-case on executable crate name #111130
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Could you please add a UI test so this doesn't regress? There's instructions in https://rustc-dev-guide.rust-lang.org/tests/ui.html#ui-tests. |
This comment has been minimized.
This comment has been minimized.
@jyn514 Yes, I will read that right now. |
oh lol looks like there was already tests for this - you can probably just change those to check-pass :) |
I think on linux, the snake or dash case naming style is very common. I can count few binaries that don't have snake case. Edit: concrete numbers: |
@jyn514 I don't really want to discuss this further, I just wanted to give the linux point of view. I understand that windows and Mac OS have different points of view and ultimately it doesn't matter that much, so one can probably have this PR. |
@jyn514 I added the UI tests and extend them to check every |
The dominant naming convention on Linux is alllowercasemashedtogetherwithoutrestraint except with the caveat that it usually also is constrained to about 6 letters... notably, the binary produced by the Rust build system is named rustc, not RustC, rustC, rust-c, or rust_c. This is the same "naming convention", if you want to call it that, used to entitle |
Hi @workingjubilee, I am not sure if I understood your comment fully (especially the last line, English is not my first language)... The discussion occured there #45127. I see you mention on Linux, so I remind everyone that on the frontpage of the Rust website is mentioned cross-platform. And on other OS, binary names have other conventions. If you wish to keep such a lint on the binary name, make a PR to add that. Here the main issue is that the only solution left for the people requiring to name their binary differently is to use |
Oh, I agree with the intent and implementation of this PR (not that I've reviewed it closely), no worry there. |
@bors r+ |
…i-obk Don't lint snake-case on executable crate name Fix rust-lang#45127 Hi, First PR on Rust, I tried my best to follow "Rust Compiler Development Guide". I tested it with a custom toolchain on a dummy bin crate with one submodule and it seems to work. The lint `non_snake_case` ignore the binary crate name but not the module name. Thank you `@Manishearth` and `@jyn514` for the guidance !
This failed during rollup: #111464 (comment) @bors r- |
Not sure if I understood the output correctly, but it seems expected since the PR has for goal to not lint in the case where the crate_type include I am not familiar with "rollup". |
@GilShoshan94 here is the error:
Notice how it says "warning: dropping unsupported crate type See https://forge.rust-lang.org/release/rollups.html for more information about rollups. |
Thank you, I will look into this when I can. |
@GilShoshan94 any updates on this? |
@Dylan-DPC No sorry, I had no time available, lots of work and personal stuff. I also moved city... I hope I will have more time end of the year to contribute. |
yeah sure that's fine. I am going to close this for the time being. Whenever you get the time you can work on it and reöpen and push to it or create a new pr with it and we can take it forward from there. Thanks |
…henkov Don't lint on executable crates with `non_snake_case` names Revives rust-lang#111130, cc `@GilShoshan94.` Closes rust-lang#45127.
…nkov Don't lint on executable crates with `non_snake_case` names Revives rust-lang#111130, cc `@GilShoshan94.` Closes rust-lang#45127.
…henkov Don't lint on executable crates with `non_snake_case` names Revives rust-lang#111130, cc `@GilShoshan94.` Closes rust-lang#45127.
Rollup merge of rust-lang#121749 - jieyouxu:issue-45127-fix, r=petrochenkov Don't lint on executable crates with `non_snake_case` names Revives rust-lang#111130, cc `@GilShoshan94.` Closes rust-lang#45127.
Fix #45127
Hi,
First PR on Rust, I tried my best to follow "Rust Compiler Development Guide".
I tested it with a custom toolchain on a dummy bin crate with one submodule and it seems to work.
The lint
non_snake_case
ignore the binary crate name but not the module name.Thank you @Manishearth and @jyn514 for the guidance !