From 17acf2dccb35f310ff4d2e63a259b782f4ab32d7 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Thu, 26 Jun 2025 11:35:36 -0700 Subject: [PATCH] Updated formatting of several rules --- data/rules/gitlab.yml | 9 +++++++-- src/main.rs | 2 +- src/update.rs | 11 +++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/rules/gitlab.yml b/data/rules/gitlab.yml index 336d29c..e616a93 100644 --- a/data/rules/gitlab.yml +++ b/data/rules/gitlab.yml @@ -50,6 +50,8 @@ rules: --run-untagged="true" \ --locked="false" \ --access-level="not_protected" + references: + - https://docs.gitlab.com/api/runners/ validation: type: Http content: @@ -62,7 +64,7 @@ rules: response_matcher: - report_response: true - type: StatusMatch - status: [200, 201] + status: 200 url: https://gitlab.com/api/v4/runners/verify - name: GitLab Pipeline Trigger Token @@ -76,6 +78,8 @@ rules: --no-progress-meter \ -F token=glptt-0d66598d696a02da33fb65e2a041f607c68ea50d \ -F ref=main + references: + - https://docs.gitlab.com/api/pipeline_triggers/ validation: type: Http content: @@ -86,5 +90,6 @@ rules: response_matcher: - report_response: true - type: StatusMatch - status: [200] + status: + - 200 url: https://gitlab.com/api/v4/ci/pipeline_triggers/{{ TOKEN }} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 7314aa2..5be8672 100644 --- a/src/main.rs +++ b/src/main.rs @@ -190,7 +190,7 @@ async fn async_main(args: CommandLineArgs) -> Result<()> { let rules_db = Arc::new(load_and_record_rules(&scan_args, &datastore)?); run_scan(&args.global_args, &scan_args, &rules_db, Arc::clone(&datastore)).await?; let exit_code = determine_exit_code(&datastore); - + temp_dir.close()?; std::process::exit(exit_code); } diff --git a/src/update.rs b/src/update.rs index 5648855..8bfc11a 100644 --- a/src/update.rs +++ b/src/update.rs @@ -7,8 +7,7 @@ use std::{ use self_update::{backends::github::Update, cargo_crate_version, errors::Error as UpdError}; use tracing::{error, info, warn}; -use crate::cli::global::GlobalArgs; -use crate::reporter::styles::Styles; +use crate::{cli::global::GlobalArgs, reporter::styles::Styles}; /// Return `true` when the canonical executable path lives inside a Homebrew Cellar. /// Works for Intel macOS (/usr/local/Cellar), Apple‑Silicon macOS (/opt/homebrew/Cellar) @@ -18,9 +17,7 @@ fn installed_via_homebrew() -> bool { std::env::current_exe().ok().and_then(|p| fs::canonicalize(p).ok()) } - canonical_exe() - .map(|p| p.components().any(|c| c.as_os_str() == "Cellar")) - .unwrap_or(false) + canonical_exe().map(|p| p.components().any(|c| c.as_os_str() == "Cellar")).unwrap_or(false) } /// Check GitHub for a newer Kingfisher release. @@ -34,9 +31,7 @@ pub fn check_for_update(global_args: &GlobalArgs, base_url: Option<&str>) -> Opt let is_brew = installed_via_homebrew(); if is_brew { - info!( - "Homebrew install detected – will notify about updates but not self‑update" - ); + info!("Homebrew install detected – will notify about updates but not self‑update"); } info!("Checking for updates…");