Skip to content

Changed NonCamelCaseTypes lint to warn by default #12290

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
Feb 21, 2014

Conversation

mrshu
Copy link
Contributor

@mrshu mrshu commented Feb 15, 2014

This first part of my attempts to fix #11432.

In this one I only set NonCamelCaseTypes to warn by default and tried to fix errors that were reported by make check.

Please feel free to let me know if I missed something or didn't do it the right way.

Thanks.

@@ -260,6 +260,7 @@ mod imp {
pub static EPOLLHUP: libc::c_int = 0x010;
pub static EPOLLONESHOT: libc::c_int = 1 << 30;

#[allow(non_camel_case_types)]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this attribute can go on mod imp along with the dead_code one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I am not sure what you mean.

Could you please be a bit more precise?

Copy link
Member

Choose a reason for hiding this comment

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

Sure.

You've attached allow(non_camel_case_types) to 4 types in this module (they're all grouped inside the mod imp on line 247), so I think it might be neater to just make this attribute apply to the whole module, like how the #[allow(dead_code)] one on line 246 applies to the whole module.

Copy link
Member

Choose a reason for hiding this comment

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

This is quite a common pattern in libnative, so you may just want to move the allow to the crate level instead of the module level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @huonw, I get it now.

@alexcrichton I did it the way you suggested, however I am not sure if this is not counter productive to the main goal of this issue (promoting standards for new code). On the other hand, I am quite sure that anyone who will write new code for libnative will keep standards in mind.

@alexcrichton
Copy link
Member

This looks good to me, feel free to comment on the PR whenever you update it because sadly github doesn't sent out notifications on force-pushes.

Also, could you squash the commits into just one? Thanks!

@mrshu
Copy link
Contributor Author

mrshu commented Feb 19, 2014

@alexcrichton If it was possible, I would like to turn on the linters one by one and also send separate pull requests for each of them. Even just with this one, when I set it to warn there were more than 300 errors waiting for me.

@alexcrichton
Copy link
Member

Sure thing, sounds good to me. Thanks for doing this work, it's much appreciated!

@mrshu
Copy link
Contributor Author

mrshu commented Feb 20, 2014

@alexcrichton Sorry for the mess, new issues were introduced in master in the meantime.

It should now pass the test suite.

@alexcrichton
Copy link
Member

No worries, thanks!

@mrshu
Copy link
Contributor Author

mrshu commented Feb 20, 2014

Sorry again @alexcrichton, for some reason I missed that timer.

It should really be good to go now.

Thanks for your patience.

Added allow(non_camel_case_types) to librustc where necesary

Tried to fix problems with non_camel_case_types outside rustc

fixed failing tests

Docs updated

Moved #[allow(non_camel_case_types)] a level higher.

markdown.rs reverted

Fixed timer that was failing tests

Fixed another timer
@mrshu
Copy link
Contributor Author

mrshu commented Feb 21, 2014

@alexcrichton I missed some once again.

I am wondering how is this possible, make check shows nothing for me. Maybe because I'm not using Windows?

bors added a commit that referenced this pull request Feb 21, 2014
This first part of my attempts to fix #11432.

In this one I only set NonCamelCaseTypes to warn by default and tried to fix errors that were reported by `make check`.

Please feel free to let me know if I missed something or didn't do it the right way.

Thanks.
@bors bors closed this Feb 21, 2014
@bors bors merged commit 70319f7 into rust-lang:master Feb 21, 2014
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.

Turn style lints to warn by default
4 participants