Skip to content

Lint non-snake-case crate names #24592

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

Merged
merged 1 commit into from
Apr 19, 2015
Merged

Conversation

ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Apr 19, 2015

Passing a non-snake-case name to #![crate_name] or --crate-name will now yield a warning from the non_snake_case lint.

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

if let Some(ref name) = cx.tcx.sess.opts.crate_name {
self.check_snake_case(cx, "crate", name, None);
} else if let Some(ref name) = attr_crate_name {
self.check_snake_case(cx, "crate", name, None);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this branch we have an attribute, so perhaps the span of the attribute could be passed?

@alexcrichton
Copy link
Member

Thanks!

Passing a non-snake-case name to #![crate_name] or --crate-name will now yield a
warning from the `non_snake_case` lint.
@ftxqxd ftxqxd force-pushed the style-lints-changes branch from f284843 to c163f89 Compare April 19, 2015 08:31
@ftxqxd
Copy link
Contributor Author

ftxqxd commented Apr 19, 2015

OK, it now shows the error on the attribute’s span if one exists.

@alexcrichton
Copy link
Member

@bors: r+ c163f89

@bors
Copy link
Collaborator

bors commented Apr 19, 2015

⌛ Testing commit c163f89 with merge c64feb6...

bors added a commit that referenced this pull request Apr 19, 2015
Passing a non-snake-case name to `#![crate_name]` or `--crate-name` will now yield a warning from the `non_snake_case` lint.
@bors bors merged commit c163f89 into rust-lang:master Apr 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants