Skip to content

Commit 0f061de

Browse files
authored
Merge pull request #7779 from cakebaker/ci_lint_selinux
ci: lint with selinux
2 parents d59ac49 + 3210638 commit 0f061de

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/CICD.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,3 +1198,5 @@ jobs:
11981198
run: |
11991199
lima ls
12001200
lima bash -c "cd work && cargo test --features 'feat_selinux'"
1201+
- name: Lint with SELinux
1202+
run: lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' -- -D warnings"

src/uucore/src/lib/features/selinux.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ pub fn set_selinux_security_context(path: &Path, context: Option<&String>) -> Re
144144
/// Err(Error::ContextConversionFailure) => println!("Failed to convert the security context to a string"),
145145
/// }
146146
/// ```
147-
148147
pub fn get_selinux_security_context(path: &Path) -> Result<String, Error> {
149148
if !is_selinux_enabled() {
150149
return Err(Error::SELinuxNotEnabled);

tests/by-util/test_ls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,10 +4193,10 @@ fn test_ls_context_long() {
41934193
for c_flag in ["-Zl", "-Zal"] {
41944194
let result = scene.ucmd().args(&[c_flag, "foo"]).succeeds();
41954195

4196-
let line: Vec<_> = result.stdout_str().split(" ").collect();
4197-
assert!(line[0].ends_with("."));
4196+
let line: Vec<_> = result.stdout_str().split(' ').collect();
4197+
assert!(line[0].ends_with('.'));
41984198
assert!(line[4].starts_with("unconfined_u"));
4199-
let s: Vec<_> = line[4].split(":").collect();
4199+
let s: Vec<_> = line[4].split(':').collect();
42004200
assert!(s.len() == 4);
42014201
}
42024202
}

tests/by-util/test_stat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,6 @@ fn test_stat_selinux() {
511511
.stdout_contains("system_u");
512512
// Count that we have 4 fields
513513
let result = ts.ucmd().arg("--printf='%C'").arg("/bin/").succeeds();
514-
let s: Vec<_> = result.stdout_str().split(":").collect();
514+
let s: Vec<_> = result.stdout_str().split(':').collect();
515515
assert!(s.len() == 4);
516516
}

0 commit comments

Comments
 (0)