Skip to content

Commit

Permalink
Make git2 an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Sep 20, 2021
1 parent bf51e0c commit e5ce5b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cargo-dylint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ clap = "3.0.0-beta.4"
env_logger = "0.9.0"

dylint = { version = "=1.0.4", path = "../dylint", features = ["dylint_driver_local"] }
dylint_internal = { version = "=1.0.4", path = "../internal" }
dylint_internal = { version = "=1.0.4", path = "../internal", features = ["git2"] }

[dev-dependencies]
assert_cmd = "2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/clippy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", tag = "rust-1
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", tag = "rust-1.54.0"}
serde_json = "1.0.67"

dylint_internal = { path = "../../internal" }
dylint_internal = { path = "../../internal", features = ["git2"] }
dylint_linting = { path = "../../utils/linting" }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/trailofbits/dylint"
[dependencies]
anyhow = "1.0.44"
cargo_metadata = "0.14.0"
git2 = "0.13.22"
git2 = { version = "0.13.22", optional = true }
if_chain = "1.0.2"
log = "0.4.14"
sedregex = "0.2.4"
4 changes: 4 additions & 0 deletions internal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pub mod examples;
mod filename;
pub use filename::library_filename;

#[cfg(feature = "git2")]
mod git;
#[cfg(feature = "git2")]
pub use git::*;

pub mod path;
Expand All @@ -21,5 +23,7 @@ pub mod rustup;
mod sed;
pub use sed::find_and_replace;

#[cfg(feature = "git2")]
pub mod testing;
#[cfg(feature = "git2")]
pub use testing::checkout_dylint_template;

0 comments on commit e5ce5b9

Please sign in to comment.