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

Fix cargo_common_metadata warning on publish = false. #6650

Merged
merged 11 commits into from
Feb 11, 2021
Merged

Fix cargo_common_metadata warning on publish = false. #6650

merged 11 commits into from
Feb 11, 2021

Conversation

daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Jan 29, 2021

I believe cargo_common_metadata shouldn't trigger when publish = false, not sure if everybody agrees.
Made some tests to handle all edge-cases.

Fixes #6649.

changelog: cargo_common_metadata: No longer lints if publish = false is defined in the manifest

@rust-highfive
Copy link

r? @flip1995

(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 Jan 29, 2021
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Feb 2, 2021
clippy_lints/src/utils/conf.rs Outdated Show resolved Hide resolved
clippy_lints/src/cargo_common_metadata.rs Show resolved Hide resolved
tests/ui-cargo/cargo_common_metadata/fail/Cargo.toml Outdated Show resolved Hide resolved
@@ -1,4 +1,4 @@
error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `unreadable-literal-lint-fractions`, `third-party` at line 5 column 1
error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `unreadable-literal-lint-fractions`, `cargo-ignore-publish`, `third-party` at line 5 column 1
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 not optimal, because it makes this option visible to the user. Nothing we can do here though, jjust for future reference. (But the error message is also horrible, so it's not that bad)

@flip1995
Copy link
Member

@bors r+

Thanks! (Also for explaining the publish field to me.TIL)

@bors
Copy link
Contributor

bors commented Feb 11, 2021

📌 Commit fd8b5fa has been approved by flip1995

@bors
Copy link
Contributor

bors commented Feb 11, 2021

⌛ Testing commit fd8b5fa with merge beb49ba...

@bors
Copy link
Contributor

bors commented Feb 11, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing beb49ba to master...

@bors bors merged commit beb49ba into rust-lang:master Feb 11, 2021
@daxpedda daxpedda deleted the cargo-common-metadata-publish branch February 11, 2021 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo_common_metadata shouldn't warn on publish = false
4 participants