Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions Cargo.lock

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

13 changes: 2 additions & 11 deletions src/cli/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ use std::{
};

use anyhow::{Context, bail};
use chrono::{DateTime, Utc};
use clap::Args;
use rayon::{ThreadPoolBuilder, prelude::*};
use serde::{Deserialize, Serialize};
use tempfile::tempdir;

use crate::cli::{CliResult, SUCCESS, resolve_path, resolve_root};
Expand Down Expand Up @@ -36,13 +34,6 @@ pub struct ScanArgs {
threads: Option<usize>,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
struct Repo {
name: String,
pushed_at: DateTime<Utc>,
}

// read string from dev/jsonextra.json.tmpl
const TEMPLATE: &str = include_str!("../data/jsonextra.json.tmpl");

Expand Down Expand Up @@ -107,8 +98,8 @@ pub fn scan(args: ScanArgs) -> CliResult {
Ok(())
} else {
bail!(
"Failed to scan in {:?}: {:?}\n{}",
source_path,
"Failed to scan in {}: {:?}\n{}",
source_path.display(),
command,
String::from_utf8(output.stderr)?,
)
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl FromStr for RegexTarget {
"secret" => Ok(Self::Secret),
"match" => Ok(Self::Match),
"line" => Ok(Self::Line),
_ => bail!("Invalid regex target: {}", s),
_ => bail!("Invalid regex target: {s}"),
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions tests/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ pub fn check_gitleaks() -> Result<()> {
let expected = Version::parse("8.21.3")?;
if version < expected {
bail!(
"gitleaks is too old. Please install latest gitleaks. See .github/workflows/cicd.yml to setup: detected={}, expected={}",
version,
expected
"gitleaks is too old. Please install latest gitleaks. See .github/workflows/cicd.yml to setup: detected={version}, expected={expected}",
);
}
Ok(())
Expand Down
Loading