forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#9216 - smoelius:master, r=flip1995
Add `ui_cargo_toml_metadata` test This PR adds a test to check the metadata of packages in the `ui_cargo` directory. A recent change to Cargo causes it to warn when it finds multiple packages with the same name in a git dependency (the issue is described [here](rust-lang/cargo#10752)). Many (if not all) Dylint libraries depend upon `clippy_utils`. As a result of the change, one now sees the following when building a Dylint library: ``` warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/pass_mod` warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/fail_no_mod` warning: skipping duplicate package `cargo_common_metadata` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_common_metadata/fail_publish_true` warning: skipping duplicate package `fail-cargo` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/pass_cargo` warning: skipping duplicate package `fail-clippy` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_clippy` warning: skipping duplicate package `fail-both-same` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_both_same` warning: skipping duplicate package `fail-file-attr` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_file_attr` ``` There appear to be two contributing factors: - Some packages in `ui_cargo` could have a `publish = false` added to them. - Some packages in `ui_cargo` seem to be inconsistently named. The new test checks that each package in the `ui_cargo` directory has a name matching one of its parent directories, and `publish = false` in its metadata (with a few exceptions). Note that the packages in `cargo_common_metadata` require special care because `publish` is the subject of some of the `cargo_common_metadata` tests. Also note that this PR adds `walkdir` as a dev dependency to the `clippy` package. However, it was already a dependency of `clippy_dev` and `lintcheck`. So hopefully this is acceptable. Our continued thanks for making `clippy_utils` available, BTW. :) r? `@flip1995` changelog: none
- Loading branch information
Showing
28 changed files
with
90 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "cargo_common_metadata" | ||
name = "cargo_common_metadata_fail" | ||
version = "0.1.0" | ||
publish = false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
error: package `cargo_common_metadata` is missing `package.description` metadata | ||
error: package `cargo_common_metadata_fail` is missing `package.description` metadata | ||
| | ||
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings` | ||
|
||
error: package `cargo_common_metadata` is missing `either package.license or package.license_file` metadata | ||
error: package `cargo_common_metadata_fail` 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_fail` is missing `package.repository` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.readme` metadata | ||
error: package `cargo_common_metadata_fail` is missing `package.readme` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.keywords` metadata | ||
error: package `cargo_common_metadata_fail` is missing `package.keywords` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.categories` metadata | ||
error: package `cargo_common_metadata_fail` is missing `package.categories` metadata | ||
|
||
error: aborting due to 6 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
tests/ui-cargo/cargo_common_metadata/fail_publish/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
error: package `cargo_common_metadata` is missing `package.description` metadata | ||
error: package `cargo_common_metadata_fail_publish` is missing `package.description` metadata | ||
| | ||
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings` | ||
|
||
error: package `cargo_common_metadata` is missing `either package.license or package.license_file` metadata | ||
error: package `cargo_common_metadata_fail_publish` 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_fail_publish` is missing `package.repository` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.readme` metadata | ||
error: package `cargo_common_metadata_fail_publish` is missing `package.readme` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.keywords` metadata | ||
error: package `cargo_common_metadata_fail_publish` is missing `package.keywords` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.categories` metadata | ||
error: package `cargo_common_metadata_fail_publish` is missing `package.categories` metadata | ||
|
||
error: aborting due to 6 previous errors | ||
|
2 changes: 1 addition & 1 deletion
2
tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
tests/ui-cargo/cargo_common_metadata/fail_publish_true/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
error: package `cargo_common_metadata` is missing `package.description` metadata | ||
error: package `cargo_common_metadata_fail_publish_true` is missing `package.description` metadata | ||
| | ||
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings` | ||
|
||
error: package `cargo_common_metadata` is missing `either package.license or package.license_file` metadata | ||
error: package `cargo_common_metadata_fail_publish_true` 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_fail_publish_true` is missing `package.repository` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.readme` metadata | ||
error: package `cargo_common_metadata_fail_publish_true` is missing `package.readme` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.keywords` metadata | ||
error: package `cargo_common_metadata_fail_publish_true` is missing `package.keywords` metadata | ||
|
||
error: package `cargo_common_metadata` is missing `package.categories` metadata | ||
error: package `cargo_common_metadata_fail_publish_true` is missing `package.categories` metadata | ||
|
||
error: aborting due to 6 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/ui-cargo/cargo_common_metadata/pass_publish_empty/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/ui-cargo/cargo_common_metadata/pass_publish_false/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "cargo_common_metadata" | ||
name = "multiple_crate_versions" | ||
version = "0.1.0" | ||
publish = false | ||
|
||
|