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

cargo_common_metadata shouldn't warn on publish = false #6649

Closed
daxpedda opened this issue Jan 29, 2021 · 0 comments · Fixed by #6650
Closed

cargo_common_metadata shouldn't warn on publish = false #6649

daxpedda opened this issue Jan 29, 2021 · 0 comments · Fixed by #6650
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@daxpedda
Copy link
Contributor

Lint name: cargo_common_metadata

I tried this code:

[package]
name = "cargo_common_metadata"
version = "0.1.0"
publish = false

I expected to see this happen:
I expect no errors to happen, because publish is set to false.
Sometimes you have crates in your workspace that you only use for testing or other purposes, which don't need any of the metadata, this is why they have publish = false.

Instead, this happened:

Warnings:
error: package `cargo_common_metadata` is missing `package.authors` metadata
   |
   = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`

error: package `cargo_common_metadata` is missing `package.description` metadata

error: package `cargo_common_metadata` is missing `either package.license or package.license_file` metadata

error: package `cargo_common_metadata` is missing `package.repository` metadata

error: package `cargo_common_metadata` is missing `package.readme` metadata

error: package `cargo_common_metadata` is missing `package.keywords` metadata

error: package `cargo_common_metadata` is missing `package.categories` metadata

error: aborting due to 7 previous errors

Meta

  • cargo clippy -V: e.g. clippy 0.0.212 (f455e46 2020-06-20)
  • rustc -Vv:
    rustc 1.51.0-nightly (e38fb306b 2021-01-14)
    binary: rustc
    commit-hash: e38fb306b7f5e65cca34df2dab1f0db15e1defb4
    commit-date: 2021-01-14
    host: x86_64-unknown-linux-gnu
    release: 1.51.0-nightly
    LLVM version: 11.0
    
@daxpedda daxpedda added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Jan 29, 2021
@bors bors closed this as completed in beb49ba Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant