Skip to content

Commit

Permalink
Release v0.6.1 (#39)
Browse files Browse the repository at this point in the history
* Update regex

* Release `v0.6.1`

Signed-off-by: Xavier Lau <xavier@inv.cafe>

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>
  • Loading branch information
aurexav authored Sep 13, 2023
1 parent 8fde2eb commit 47a60c5
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 67 deletions.
116 changes: 63 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0"
name = "cargo-featalign"
readme = "README.md"
repository = "https://github.com/hack-ink/cargo-featalign"
version = "0.6.0"
version = "0.6.1"

[profile.ci-dev]
incremental = false
Expand All @@ -31,7 +31,7 @@ once_cell = { version = "1.18" }
regex = { version = "1.9" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
toml_edit = { version = "0.19" }
toml_edit = { version = "0.20" }

[build-dependencies]
# crates.io
Expand Down
14 changes: 9 additions & 5 deletions src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ impl Analyzer {
let n = self.resolve.get_by_id(&d.pkg).unwrap().to_owned();
let p = self.metadata.get_by_id(&d.pkg).unwrap().to_owned();
let dependency_path = dependency_path.clone();
let psr = self.clone();

shared::activate_thread(&mut ts, move || {
psr.analyze_crate(n, p, depth - 1, dependency_path)
});
let analyzer = self.clone();

if depth > 8 {
analyzer.analyze_crate(n, p, depth - 1, dependency_path);
} else {
shared::activate_thread(&mut ts, move || {
analyzer.analyze_crate(n, p, depth - 1, dependency_path)
});
}
}

shared::deactivate_threads(ts);
Expand Down
17 changes: 13 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod util;
#[cfg(test)] mod test;

// std
use std::env;
use std::{env, process};

fn main() -> prelude::Result<()> {
color_eyre::install().map_err(|e| anyhow::anyhow!(e))?;
Expand All @@ -36,15 +36,24 @@ fn main() -> prelude::Result<()> {

let Cli { shared_initiator, analyzer_initiator, depth, resolver_initiator, verbose } =
Cli::parse_from(args);
let mut exit_code = 0;

Shared::initialize(shared_initiator);
Analyzer::initialize(analyzer_initiator).analyze(depth);

if verbose || *MODE.get().unwrap() == Mode::Check {
println!("{}", serde_json::to_string(&*PROBLEMS.lock().unwrap()).unwrap());
let problems = PROBLEMS.lock().unwrap();
let mode = MODE.get().unwrap();

if verbose || matches!(mode, Mode::Check) {
println!("{}", serde_json::to_string(&*problems).unwrap());
}
if !problems.is_empty() && matches!(mode, Mode::Check | Mode::DryRun | Mode::DryRun2) {
exit_code = -1;
}

drop(problems);

Resolver::initialize(resolver_initiator).resolve()?;

Ok(())
process::exit(exit_code);
}
3 changes: 1 addition & 2 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ use crate::{
sorter::SortVisitor,
};

static PATH_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r".+? \d.\d.\d \(path\+file://(/.+?)\)").unwrap());
static PATH_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r".+?\(path\+file://(/.+?)\)").unwrap());

static SORT: OnceCell<bool> = OnceCell::new();

Expand Down
Loading

0 comments on commit 47a60c5

Please sign in to comment.