Skip to content

Commit 45ca3a3

Browse files
committed
Switch to detsys-ids-client
1 parent 28d8a08 commit 45ca3a3

File tree

3 files changed

+113
-6
lines changed

3 files changed

+113
-6
lines changed

Cargo.lock

Lines changed: 100 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ clap = { version = "4.3.0", default-features = false, features = [
2323
"std",
2424
"wrap_help",
2525
] }
26-
detsys-ids-client = { path = "../detsys-ids-client", features = ["tracing-instrument"] }
26+
detsys-ids-client = { version = "0.2.0", features = ["tracing-instrument"] }
2727
handlebars = { version = "4.3.7", default-features = false }
2828
parse-flake-lock = { path = "./parse-flake-lock" }
2929
reqwest = { version = "0.11.18", default-features = false, features = [
@@ -35,6 +35,8 @@ serde = { workspace = true }
3535
serde_json = { workspace = true }
3636
thiserror = { workspace = true }
3737
tokio = { version = "1", features = ["full", "tracing"] }
38+
tracing = "0.1.41"
39+
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
3840

3941
[features]
4042
default = []

src/main.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ mod summary;
77
#[cfg(feature = "ref-statuses")]
88
mod ref_statuses;
99

10-
use error::FlakeCheckerError;
11-
use flake::{check_flake_lock, FlakeCheckConfig};
12-
use summary::Summary;
13-
1410
use std::collections::HashMap;
1511
use std::path::PathBuf;
1612
use std::process::ExitCode;
1713

1814
use clap::Parser;
1915
use parse_flake_lock::FlakeLock;
16+
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
2017

2118
use crate::condition::evaluate_condition;
19+
use error::FlakeCheckerError;
20+
use flake::{check_flake_lock, FlakeCheckConfig};
21+
use summary::Summary;
2222

2323
/// A flake.lock checker for Nix projects.
2424
#[cfg(not(feature = "ref-statuses"))]
@@ -115,6 +115,11 @@ pub(crate) fn supported_refs(ref_statuses: HashMap<String, String>) -> Vec<Strin
115115
#[cfg(not(feature = "ref-statuses"))]
116116
#[tokio::main]
117117
async fn main() -> Result<ExitCode, FlakeCheckerError> {
118+
tracing_subscriber::registry()
119+
.with(fmt::layer())
120+
.with(EnvFilter::from_default_env())
121+
.init();
122+
118123
let ref_statuses: HashMap<String, String> =
119124
serde_json::from_str(include_str!("../ref-statuses.json")).unwrap();
120125

@@ -226,6 +231,7 @@ async fn main() -> Result<ExitCode, FlakeCheckerError> {
226231
summary.generate_text()?;
227232
}
228233

234+
drop(reporter);
229235
worker.wait().await;
230236

231237
if fail_mode && !issues.is_empty() {

0 commit comments

Comments
 (0)