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
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
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:
Expand Down
1 change: 0 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 8 additions & 11 deletions src/uucore/src/lib/features/backup_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,37 +667,34 @@ 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~")
);
}

#[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")
);
}
Expand Down
11 changes: 10 additions & 1 deletion src/uucore/src/lib/features/proc_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand All @@ -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::{
Expand Down
Loading