-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to allow wildcard path dependencies (#487)
* Add option to allow wildcard path dependencies Adds an `allow-wildcard-paths` option for the `bans` check which will allow path dependencies to use wildcard versions if the crate is private or the dependency is a dev-dependency. Closes issue #448 * Rustfmt * Fix clippy lints * Ignore atty advisory * Oops * Ignore wildcard paths in git sources Co-authored-by: Jake Shadle <[email protected]>
- Loading branch information
1 parent
967450b
commit 05e1b34
Showing
20 changed files
with
1,591 additions
and
14 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
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
5 changes: 5 additions & 0 deletions
5
tests/snapshots/bans__allow_path_wildcards_private_package.snap
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: tests/bans.rs | ||
expression: diags | ||
--- | ||
[] |
30 changes: 30 additions & 0 deletions
30
tests/snapshots/bans__allow_path_wildcards_public_package.snap
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: tests/bans.rs | ||
expression: diags | ||
--- | ||
[ | ||
{ | ||
"fields": { | ||
"code": "wildcard", | ||
"graphs": [ | ||
{ | ||
"Krate": { | ||
"name": "wildcards-test-allow-paths-public", | ||
"version": "0.1.0" | ||
} | ||
} | ||
], | ||
"labels": [ | ||
{ | ||
"column": 1, | ||
"line": 1, | ||
"message": "wildcard crate entry", | ||
"span": "wildcards-test-allow-paths-dependency = '*'" | ||
} | ||
], | ||
"message": "found 1 wildcard dependency for crate 'wildcards-test-allow-paths-public'. allow-wildcard-paths is enabled, but does not apply to public crates as crates.io disallows path dependencies.", | ||
"severity": "error" | ||
}, | ||
"type": "diagnostic" | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
tests/test_data/wildcards/allow-paths-dependency/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "wildcards-test-allow-paths-dependency" | ||
version = "0.1.0" | ||
authors = [] | ||
edition = "2018" | ||
license = "MIT" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
sqlx = "0.5" |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
fn main() {} |
Oops, something went wrong.