-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat
git
dependencies the same as path
dependencies for `allow-w…
…ildcard-paths`. (#599) Fixes #488, making it possible to ban wildcards without also banning git-only dependencies. This may not be a perfect fit for some use cases — arguably `git` dependencies are less implicitly-versioned than `path` dependencies since `path` dependencies are typically always the same revision of the same repo, but `git` dependencies might be `cargo update`d to totally different code. But I can't think of an alternative that's equal-or-better in correctness short of introducing even more configuration. (I suspect that the whole idea of counting path-only or git-only deps as wildcard versions *ever* is wrong, because [the Cargo documentation says](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-path-dependencies) that “…the version key always implies that the package is available in a registry. version, git, and path keys are considered [separate locations](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#multiple-locations) for resolving the dependency” — which implies that a dep *without* `version` is different from a dep with a wildcard version. However, figuring out Cargo's behavior there and how cargo-deny should treat it feels like a rabbit hole I don't want to go down just to fix #488. I left a TODO comment suggesting further consideration.)
- Loading branch information
Showing
7 changed files
with
269 additions
and
7 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
5 changes: 5 additions & 0 deletions
5
tests/snapshots/bans__allow_git_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 | ||
--- | ||
[] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,14 @@ | ||
[package] | ||
name = "wildcards-test-allow-git" | ||
version = "0.1.0" | ||
authors = [] | ||
edition = "2018" | ||
license = "MIT" | ||
|
||
publish = false | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
# An arbitrary choice of actually existant Git repository | ||
wildcards-test-allow-git = { package = "krates", git = "https://github.com/EmbarkStudios/krates", rev = "b03ecd6f3204a1b1ec04fbaead2d0d122a3a4494" } |
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() {} |