Skip to content

Commit 17d4da3

Browse files
committed
" ## Run cspell
unset fault fault_type="error" fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]') # * find cspell configuration ; note: avoid quotes around ${cfg_file} b/c `cspell` (v4) doesn't correctly dequote the config argument (or perhaps a subshell expansion issue?) cfg_files=($(shopt -s nullglob ; echo {.vscode,.}/{,.}c[sS]pell{.json,.config{.js,.cjs,.json,.yaml,.yml},.yaml,.yml} ;)) cfg_file=${cfg_files[0]} unset CSPELL_CFG_OPTION ; if [ -n "$cfg_file" ]; then CSPELL_CFG_OPTION="--config $cfg_file" ; fi S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/${PWD//\//\\/}\/(.*):(.*):(.*) - (.*)/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \4 (file:'\1', line:\2)/p" ; fault=true ; true ; } if [ -n "true" ] && [ -n "$fault" ]; then exit 1 ; fi shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} env: STYLE_FAIL_ON_FAULT: true tests/by-util/test_cat.rs:14:56 - Unknown word (EPIPE) Error: Process completed with exit code 1. " bug on `action` "Style/spelling (ubuntu-latest, feat_os_unix)"
1 parent c72abe0 commit 17d4da3

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/uu/chcon/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
#![cfg(target_os = "linux")]
1+
#[cfg(target_os = "linux")]
22
uucore::bin!(uu_chcon);
3+
4+
#[cfg(not(target_os = "linux"))]
5+
fn main() {}

src/uu/ls/src/ls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,11 +1083,11 @@ impl Config {
10831083
time_format_older,
10841084
context,
10851085
selinux_supported: {
1086-
#[cfg(feature = "selinux")]
1086+
#[cfg(all(feature = "selinux", target_os = "linux"))]
10871087
{
10881088
uucore::selinux::is_selinux_enabled()
10891089
}
1090-
#[cfg(not(feature = "selinux"))]
1090+
#[cfg(not(all(feature = "selinux", target_os = "linux")))]
10911091
{
10921092
false
10931093
}

src/uu/runcon/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
#![cfg(target_os = "linux")]
1+
#[cfg(target_os = "linux")]
22
uucore::bin!(uu_runcon);
3+
4+
#[cfg(not(target_os = "linux"))]
5+
fn main() {}

tests/by-util/test_cat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ fn test_cat_broken_pipe_nonzero_and_message() {
1010
let mut fds: [libc::c_int; 2] = [0, 0];
1111
assert_eq!(libc::pipe(fds.as_mut_ptr()), 0, "Failed to create pipe");
1212
// Close the read end to simulate a broken pipe on stdout
13-
let _read_end = File::from_raw_fd(fds[0]);
13+
let read_end = File::from_raw_fd(fds[0]);
1414
// Explicitly drop the read-end so writers see EPIPE instead of blocking on a full pipe
15-
std::mem::drop(_read_end);
15+
std::mem::drop(read_end);
1616
let write_end = File::from_raw_fd(fds[1]);
1717

1818
let content = (0..10000).map(|_| "x").collect::<String>();

0 commit comments

Comments
 (0)