mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Remove author requirement for cargo_common_metadata
This commit is contained in:
parent
86fb0e8266
commit
5102c9cc69
5 changed files with 8 additions and 21 deletions
|
@ -20,11 +20,10 @@ declare_clippy_lint! {
|
|||
///
|
||||
/// **Example:**
|
||||
/// ```toml
|
||||
/// # This `Cargo.toml` is missing an authors field:
|
||||
/// # This `Cargo.toml` is missing a description field:
|
||||
/// [package]
|
||||
/// name = "clippy"
|
||||
/// version = "0.0.212"
|
||||
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
|
||||
/// repository = "https://github.com/rust-lang/rust-clippy"
|
||||
/// readme = "README.md"
|
||||
/// license = "MIT OR Apache-2.0"
|
||||
|
@ -32,14 +31,13 @@ declare_clippy_lint! {
|
|||
/// categories = ["development-tools", "development-tools::cargo-plugins"]
|
||||
/// ```
|
||||
///
|
||||
/// Should include an authors field like:
|
||||
/// Should include a description field like:
|
||||
///
|
||||
/// ```toml
|
||||
/// # This `Cargo.toml` includes all common metadata
|
||||
/// [package]
|
||||
/// name = "clippy"
|
||||
/// version = "0.0.212"
|
||||
/// authors = ["Someone <someone@rust-lang.org>"]
|
||||
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
|
||||
/// repository = "https://github.com/rust-lang/rust-clippy"
|
||||
/// readme = "README.md"
|
||||
|
@ -97,10 +95,6 @@ impl LateLintPass<'_> for CargoCommonMetadata {
|
|||
// only run the lint if publish is `None` (`publish = true` or skipped entirely)
|
||||
// or if the vector isn't empty (`publish = ["something"]`)
|
||||
if package.publish.as_ref().filter(|publish| publish.is_empty()).is_none() || self.ignore_publish {
|
||||
if is_empty_vec(&package.authors) {
|
||||
missing_warning(cx, &package, "package.authors");
|
||||
}
|
||||
|
||||
if is_empty_str(&package.description) {
|
||||
missing_warning(cx, &package, "package.description");
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
error: package `cargo_common_metadata` is missing `package.authors` metadata
|
||||
error: package `cargo_common_metadata` is missing `package.description` 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
|
||||
|
@ -14,5 +12,5 @@ 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
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
error: package `cargo_common_metadata` is missing `package.authors` metadata
|
||||
error: package `cargo_common_metadata` is missing `package.description` 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
|
||||
|
@ -14,5 +12,5 @@ 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
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
error: package `cargo_common_metadata` is missing `package.authors` metadata
|
||||
error: package `cargo_common_metadata` is missing `package.description` 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
|
||||
|
@ -14,5 +12,5 @@ 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
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
name = "cargo_common_metadata"
|
||||
version = "0.1.0"
|
||||
publish = false
|
||||
authors = ["Random person from the Internet <someone@someplace.org>"]
|
||||
description = "A test package for the cargo_common_metadata lint"
|
||||
repository = "https://github.com/someone/cargo_common_metadata"
|
||||
readme = "README.md"
|
||||
|
|
Loading…
Reference in a new issue