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

Add lint to check that all crates have #![unstable] #31627

Merged
merged 1 commit into from
Feb 16, 2016

Conversation

KiChjang
Copy link
Member

Fixes #31122.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@KiChjang KiChjang force-pushed the unstable-lint branch 4 times, most recently from 3b14f48 to 9d796e7 Compare February 13, 2016 12:14
@KiChjang KiChjang changed the title Add lint to check that all crates have #[unstable] Add lint to check that all crates have #![unstable] Feb 13, 2016
@@ -24,6 +24,7 @@

interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
uninteresting_files = ['miniz.c', 'jquery', 'rust_android_dummy']
stable_whitelist = []
Copy link
Contributor

Choose a reason for hiding this comment

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

It surprises me that the whitelist is empty. std and core are stable and AFAICT nothing else encodes the knowledge that they're allowed to be stable, so surely they should be in the whitelist?

Copy link
Contributor

Choose a reason for hiding this comment

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

Weird, Travis says that make tidy passes. Have you tried purposefully omitting an #[unstable] annotation to see if the code catches that?

Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed it in my latest commit. Apparently the real culprit is the re.match down at if fileinput.isFirstLine() - what I really wanted was re.search() instead.

@KiChjang KiChjang force-pushed the unstable-lint branch 3 times, most recently from fad5a19 to 1d5f6ee Compare February 13, 2016 18:00
@@ -195,6 +208,9 @@ def interesting_file(f):
update_counts(current_name)
assert len(current_contents) > 0
do_license_check(current_name, current_contents)
if len(needs_unstable_attr) != 0:
for f in needs_unstable_attr:
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines could be simplified to just for f in needs_unstable_attr:

@hanna-kruppe
Copy link
Contributor

Holy crap, tidy is really hacky. But apart from the style nit and the Travis failure (should't libcollectionstest be unstable?) this change LGTM.

@KiChjang KiChjang force-pushed the unstable-lint branch 2 times, most recently from a35116b to daf3c0a Compare February 14, 2016 02:31
@KiChjang
Copy link
Member Author

Currently Travis CI builds with two failures:

/home/travis/build/rust-lang/rust/src/bootstrap/lib.rs:1: requires unstable attribute

/home/travis/build/rust-lang/rust/src/rustc/std_shim/lib.rs:1: requires unstable attribute

Shall I go ahead and add the unstable attribute to these two files?

@alexcrichton
Copy link
Member

Nah it should be ok to whitelist those two (they're not shipped)

@KiChjang
Copy link
Member Author

Updated.

@KiChjang KiChjang force-pushed the unstable-lint branch 3 times, most recently from 1e2941f to 6f092c8 Compare February 15, 2016 06:09
@alexcrichton
Copy link
Member

@bors: r+ 6f092c8

Thanks!

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 15, 2016
@bors
Copy link
Contributor

bors commented Feb 15, 2016

⌛ Testing commit 6f092c8 with merge b3a8364...

@bors
Copy link
Contributor

bors commented Feb 15, 2016

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Feb 16, 2016

⌛ Testing commit 6f092c8 with merge 19896f8...

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 16, 2016
@bors
Copy link
Contributor

bors commented Feb 16, 2016

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Feb 16, 2016

⌛ Testing commit 6f092c8 with merge 0f8f7d5...

bors added a commit that referenced this pull request Feb 16, 2016
@bors
Copy link
Contributor

bors commented Feb 16, 2016

💔 Test failed - auto-win-gnu-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Mon, Feb 15, 2016 at 7:03 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-win-gnu-64-opt
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-opt/builds/3100


Reply to this email directly or view it on GitHub
#31627 (comment).

bors added a commit that referenced this pull request Feb 16, 2016
@bors
Copy link
Contributor

bors commented Feb 16, 2016

⌛ Testing commit 6f092c8 with merge 29e8ac5...

@bors bors merged commit 6f092c8 into rust-lang:master Feb 16, 2016
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.

6 participants