Skip to content

Commit

Permalink
fix: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
innobead committed Jan 11, 2025
1 parent 6d76447 commit 97c6882
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 128 deletions.
116 changes: 0 additions & 116 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion huber-common/src/log.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::str::FromStr;

use log::LevelFilter;

use crate::model::config::Config;
Expand Down
2 changes: 0 additions & 2 deletions huber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ chrono.workspace = true

[dev-dependencies]
assert_cmd = "2.0.16"
pretty_assertions = "1.4.1"
rstest = "0.24.0"
whoami = "1.5.2"

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions huber/src/bin/huber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use anyhow::anyhow;
use clap::{CommandFactory, Parser, ValueHint};
use clap_complete::Generator;
use huber::cmd::config::ConfigCommands;
use huber::cmd::lock::LockCommands;
use huber::cmd::repo::RepoCommands;
use huber::cmd::CommandTrait;
use huber::cmd::Commands;
Expand All @@ -19,11 +20,10 @@ use huber_common::fs::dir;
use huber_common::log::Logger;
use huber_common::model::config::Config;
use libcli_rs::output::OutputFormat;
use log::{error, warn, LevelFilter};
use log::{error, LevelFilter};
use scopeguard::defer;
use simpledi_rs::di::{DIContainer, DIContainerTrait, DependencyInjectTrait};
use simpledi_rs::inject_dep;
use huber::cmd::lock::LockCommands;

#[derive(Parser)]
#[command(version, bin_name = env!("CARGO_PKG_NAME"), about, long_about = None)]
Expand Down Expand Up @@ -149,7 +149,7 @@ async fn main() {

if let Some(e) = e.downcast_ref::<HuberError>() {
let source_err = e.source().map(|e| format!(": {}", e)).unwrap_or_default();
warn!("{}{}", e, source_err);
error!("{}{}", e, source_err);
} else {
error!("{}", e);
}
Expand Down
2 changes: 1 addition & 1 deletion huber/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn test_config_not_found() {
}

huber_cmd!(arg("config").arg("show").assert().failure().stderr(format!(
"[WARN ] Config not found: \"/home/{}/.huber/config.yaml\"\n",
"[ERROR] Config not found: \"/home/{}/.huber/config.yaml\"\n",
username()
)));
}
Expand Down
2 changes: 1 addition & 1 deletion huber/tests/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn test_current_fail() {
.assert()
.failure()
.stderr(format!(
"[WARN ] Package not installed: \"{}\"\n",
"[ERROR] Package not installed: \"{}\"\n",
INVALID_PKG
)));
}
2 changes: 1 addition & 1 deletion huber/tests/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ fn test_info_fail() {
.arg(INVALID_PKG)
.assert()
.failure()
.stderr(format!("[WARN ] Package not found: \"{}\"\n", INVALID_PKG)));
.stderr(format!("[ERROR] Package not found: \"{}\"\n", INVALID_PKG)));
}
2 changes: 1 addition & 1 deletion huber/tests/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ fn test_install_fail() {
.arg(INVALID_PKG_VERSION)
.assert()
.failure()
.stderr("[WARN ] Package not found: \"pkg_notfound\"\n"));
.stderr("[ERROR] Package not found: \"pkg_notfound\"\n"));
}
2 changes: 1 addition & 1 deletion huber/tests/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn test_lock_fail() {

assert_eq_last_line!(
assert.get_output().stderr,
"[WARN ] Package unable to lock: Package not installed: \"k9s\""
"[ERROR] Package unable to lock: Package not installed: \"k9s\""
);
}

Expand Down
2 changes: 1 addition & 1 deletion huber/tests/uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ fn test_uninstall_fail() {
.arg(INVALID_PKG)
.assert()
.failure()
.stderr(format!("[WARN ] Package not found: \"{}\"\n", INVALID_PKG)));
.stderr(format!("[ERROR] Package not found: \"{}\"\n", INVALID_PKG)));
}
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ fmt:

# Fix code
fix:
@cargo install cargo-udeps
@cargo +nightly udeps --all-targets
@cargo {{ cargo_opts }} fix --allow-dirty --allow-staged

# Release binaries
Expand Down

0 comments on commit 97c6882

Please sign in to comment.