diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 814da316a..c4a166493 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -112,7 +112,7 @@ jobs: fault_type="${{ steps.vars.outputs.FAULT_TYPE }}" fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]') # * convert any warnings to GHA UI annotations; ref: - S=$(cargo clippy --all-targets --features ${{ matrix.job.features }} -pcoreutils -- ${CLIPPY_FLAGS} -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; } + S=$(cargo clippy --all-targets --features ${{ matrix.job.features }} --tests -pcoreutils -- ${CLIPPY_FLAGS} -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; } if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi style_spellcheck: diff --git a/deny.toml b/deny.toml index d64a2d33a..79bfe926e 100644 --- a/deny.toml +++ b/deny.toml @@ -22,7 +22,6 @@ allow = [ "Apache-2.0", "ISC", "BSD-2-Clause", - "BSD-2-Clause-FreeBSD", "BSD-3-Clause", "BSL-1.0", "CC0-1.0", diff --git a/src/uucore/src/lib/features/backup_control.rs b/src/uucore/src/lib/features/backup_control.rs index 4b4f7aa93..591f57f95 100644 --- a/src/uucore/src/lib/features/backup_control.rs +++ b/src/uucore/src/lib/features/backup_control.rs @@ -667,17 +667,14 @@ mod tests { #[test] fn test_numbered_backup_path() { - assert_eq!(numbered_backup_path(&Path::new("")), PathBuf::from(".~1~")); + assert_eq!(numbered_backup_path(Path::new("")), PathBuf::from(".~1~")); + assert_eq!(numbered_backup_path(Path::new("/")), PathBuf::from("/.~1~")); assert_eq!( - numbered_backup_path(&Path::new("/")), - PathBuf::from("/.~1~") - ); - assert_eq!( - numbered_backup_path(&Path::new("/hello/world")), + numbered_backup_path(Path::new("/hello/world")), PathBuf::from("/hello/world.~1~") ); assert_eq!( - numbered_backup_path(&Path::new("/hello/world/")), + numbered_backup_path(Path::new("/hello/world/")), PathBuf::from("/hello/world.~1~") ); } @@ -685,19 +682,19 @@ mod tests { #[test] fn test_simple_backup_path() { assert_eq!( - simple_backup_path(&Path::new(""), ".bak"), + simple_backup_path(Path::new(""), ".bak"), PathBuf::from(".bak") ); assert_eq!( - simple_backup_path(&Path::new("/"), ".bak"), + simple_backup_path(Path::new("/"), ".bak"), PathBuf::from("/.bak") ); assert_eq!( - simple_backup_path(&Path::new("/hello/world"), ".bak"), + simple_backup_path(Path::new("/hello/world"), ".bak"), PathBuf::from("/hello/world.bak") ); assert_eq!( - simple_backup_path(&Path::new("/hello/world/"), ".bak"), + simple_backup_path(Path::new("/hello/world/"), ".bak"), PathBuf::from("/hello/world.bak") ); } diff --git a/src/uucore/src/lib/features/proc_info.rs b/src/uucore/src/lib/features/proc_info.rs index 7c812ec2a..f40847c1d 100644 --- a/src/uucore/src/lib/features/proc_info.rs +++ b/src/uucore/src/lib/features/proc_info.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore exitstatus cmdline kworker pgrep pwait snice +// spell-checker:ignore exitstatus cmdline kworker pgrep pwait snice procps //! Set of functions to manage IDs //! @@ -19,6 +19,15 @@ //! `snice` (TBD) //! +// This file is currently flagged as dead code, because it isn't used anywhere +// in the codebase. It may be useful in the future though, so we decide to keep +// it. +// The code was originally written in procps +// (https://github.com/uutils/procps/blob/main/src/uu/pgrep/src/process.rs) +// but was eventually moved here. +// See https://github.com/uutils/coreutils/pull/6932 for discussion. +#![allow(dead_code)] + use crate::features::tty::Teletype; use std::hash::Hash; use std::{