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 internal-lints feature to enable clippys internal lints (off by default) #6308

Merged
merged 4 commits into from
Dec 3, 2020

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Nov 8, 2020

This PR moves the internal lint tests into a new subdirectory (I couldn't find a different way to compile-time-conditionally exclude them from compiletest) and only builds and tests internal lints if the internal-lints feature is enabled.

Fixes #6306

changelog: put internal lints behind a feature ("internal-lints")

@rust-highfive
Copy link

r? @llogiq

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 8, 2020
@flip1995
Copy link
Member

flip1995 commented Nov 8, 2020

This will also require updating the clippy_dev update_lints file updates.

llogiq
llogiq previously requested changes Nov 8, 2020
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

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

Just a small nit, and of course the clippy_dev update, but otherwise I like this change. Makes clippy smaller & faster to both build & run with no downside.

Cargo.toml Outdated Show resolved Hide resolved
@flip1995
Copy link
Member

flip1995 commented Nov 8, 2020

This will also require some CI changes to enable internal lints in CI. I would like to review those (or do them myself, if you want) before this gets merged, but I also like this change generally speaking.

@matthiaskrgr
Copy link
Member Author

Hm, the current roadblock is that compiletest does not seem to provide a way to skip tests based on crate features, but I need to skip some of the internal tests during default compilation...
https://rustc-dev-guide.rust-lang.org/tests/adding.html#other-header-commands

@matthiaskrgr
Copy link
Member Author

Had the showerthought to put all the internal tests into a separate directory, that might make it work.

@matthiaskrgr
Copy link
Member Author

I moved the internal tests into a new directory and cargo test and cargo test --features internal-lints passes now! 🎉
cargo dev update_lints however tries to remove my #[cfg(feature = "internal-lints")] annotations again hmm.

@matthiaskrgr
Copy link
Member Author

@bors try

bors added a commit that referenced this pull request Nov 13, 2020
WIP: add internal-lints feature to enable clippys internal lints (off by default)

I'm getting liker errors (but not compiler warnings) when building locally, checking if this affects CI as well... :/

changelog: put internal lints behind a feature
@bors
Copy link
Contributor

bors commented Nov 13, 2020

⌛ Trying commit 4148bb3 with merge 008b71c...

@bors
Copy link
Contributor

bors commented Nov 13, 2020

💔 Test failed - checks-action_test

@matthiaskrgr
Copy link
Member Author

@bors try

bors added a commit that referenced this pull request Nov 13, 2020
WIP: add internal-lints feature to enable clippys internal lints (off by default)

I'm getting liker errors (but not compiler warnings) when building locally, checking if this affects CI as well... :/

changelog: put internal lints behind a feature
@bors
Copy link
Contributor

bors commented Nov 13, 2020

⌛ Trying commit ba3f1ae with merge ab8552a...

@bors
Copy link
Contributor

bors commented Nov 13, 2020

💔 Test failed - checks-action_test

@matthiaskrgr
Copy link
Member Author

Ah this needs a rustup first... #6329

@matthiaskrgr
Copy link
Member Author

@bors try

bors added a commit that referenced this pull request Nov 13, 2020
WIP: add internal-lints feature to enable clippys internal lints (off by default)

I'm getting liker errors (but not compiler warnings) when building locally, checking if this affects CI as well... :/

changelog: put internal lints behind a feature
@bors
Copy link
Contributor

bors commented Nov 13, 2020

⌛ Trying commit bdb2fe4 with merge 7446bba...

@bors
Copy link
Contributor

bors commented Nov 13, 2020

💔 Test failed - checks-action_test

@matthiaskrgr
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Nov 13, 2020

⌛ Trying commit e9d3b59 with merge 1d7d8ce...

bors added a commit that referenced this pull request Nov 13, 2020
WIP: add internal-lints feature to enable clippys internal lints (off by default)

I'm getting liker errors (but not compiler warnings) when building locally, checking if this affects CI as well... :/

changelog: put internal lints behind a feature
@matthiaskrgr matthiaskrgr force-pushed the internal_lints branch 2 times, most recently from 6f328f9 to fa4f131 Compare November 29, 2020 20:19
clippy_lints/src/lib.rs Outdated Show resolved Hide resolved
clippy_lints/src/lib.rs Outdated Show resolved Hide resolved
clippy_lints/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +517 to +518
#[cfg(feature = "internal-lints")]
&utils::internal_lints::PRODUCE_ICE,
Copy link
Member

@flip1995 flip1995 Nov 29, 2020

Choose a reason for hiding this comment

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

Oh no, this'll get rid of our sole easteregg in Clippy :(

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmh, is this bad?

Copy link
Member

Choose a reason for hiding this comment

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

No, just a bit sad 😄

@matthiaskrgr matthiaskrgr force-pushed the internal_lints branch 2 times, most recently from 603e1af to c6f70f8 Compare November 29, 2020 21:02
@matthiaskrgr
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Nov 29, 2020

⌛ Trying commit c6f70f8 with merge 83ea8c8...

bors added a commit that referenced this pull request Nov 29, 2020
add `internal-lints` feature to enable clippys internal lints (off by default)

This PR moves the internal lint tests into a new subdirectory (I couldn't find a different way to compile-time-conditionally exclude them from compiletest) and only builds and tests internal lints if the `internal-lints` feature is enabled.

Fixes #6306

changelog: put internal lints behind a feature ("internal-lints")
@bors
Copy link
Contributor

bors commented Nov 29, 2020

☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Build commit: 83ea8c8 (83ea8c820163c1384bfb1121af1fecb1cffff0f3)

@matthiaskrgr matthiaskrgr added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Nov 29, 2020
clippy_dev/src/lib.rs Outdated Show resolved Hide resolved
ci: always build with internal lints
group up internal lints in lib.rs
dogfood: we already pass --all-features, no need to enable internal-lints again
@flip1995
Copy link
Member

@bors r+

Thanks!

(I dismissed @llogiq review, because it was about something already fixed)

@bors
Copy link
Contributor

bors commented Nov 30, 2020

📌 Commit 252083f has been approved by flip1995

@bors
Copy link
Contributor

bors commented Nov 30, 2020

⌛ Testing commit 252083f with merge 871f3ff...

bors added a commit that referenced this pull request Nov 30, 2020
add `internal-lints` feature to enable clippys internal lints (off by default)

This PR moves the internal lint tests into a new subdirectory (I couldn't find a different way to compile-time-conditionally exclude them from compiletest) and only builds and tests internal lints if the `internal-lints` feature is enabled.

Fixes #6306

changelog: put internal lints behind a feature ("internal-lints")
@bors
Copy link
Contributor

bors commented Nov 30, 2020

💔 Test failed - checks-action_test

@flip1995 flip1995 added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Nov 30, 2020
@flip1995
Copy link
Member

flip1995 commented Dec 3, 2020

@bors treeclosed=10 retry rollup

bors added a commit that referenced this pull request Dec 3, 2020
Rollup of 4 pull requests

Successful merges:

 - #6308 (add `internal-lints` feature to enable clippys internal lints (off by default))
 - #6395 (switch Version/VersionReq usages to RustcVersion )
 - #6402 (Add Collapsible match lint)
 - #6407 (CONTRIBUTING: update bors queue url from buildbot2.rlo to bors.rlo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

changelog: rollup
@bors bors merged commit c3db082 into rust-lang:master Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put internal lints behind a feature flag
6 participants