Skip to content

Commit 33e3dc6

Browse files
committed
autofix
1 parent ee95540 commit 33e3dc6

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

hack/code/autofix.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
4+
REAL_SCRIPT="$(realpath "${0}")"
5+
cd "$(dirname "${REAL_SCRIPT}")/../.."
6+
7+
cargo clippy --all --fix --allow-dirty --allow-staged
8+
cargo fmt --all

src/checkers/script.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ impl ScriptChecks {
121121
// will be self contained.
122122
let script_path = env::temp_dir().join("edera_preflight_pvh.sh");
123123
let r = fs::write(&script_path, PVH_SCRIPT);
124-
if r.is_ok() {
125-
if let Ok(metadata) = fs::metadata(&script_path) {
126-
let mut permissions = metadata.permissions();
127-
128-
permissions.set_mode(0o700);
129-
let _ = fs::set_permissions(&script_path, permissions);
130-
script_list.push(script_path);
131-
}
124+
if r.is_ok()
125+
&& let Ok(metadata) = fs::metadata(&script_path)
126+
{
127+
let mut permissions = metadata.permissions();
128+
129+
permissions.set_mode(0o700);
130+
let _ = fs::set_permissions(&script_path, permissions);
131+
script_list.push(script_path);
132132
}
133133

134134
let mut group_result = Passed;

src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
mod checkers;
2-
mod recorders;
32
mod helpers;
3+
mod recorders;
44

55
use helpers::{
66
CheckGroup, CheckGroupResult,
7-
CheckResultValue::{Errored, Failed, Passed}};
8-
9-
use checkers::{
10-
kernel::KernelChecks,
11-
script::ScriptChecks,
12-
system::SystemChecks,
7+
CheckResultValue::{Errored, Failed, Passed},
138
};
149

10+
use checkers::{kernel::KernelChecks, script::ScriptChecks, system::SystemChecks};
11+
1512
use recorders::system::SystemRecorder;
1613

1714
use anyhow::{Context, Result, anyhow, bail};

0 commit comments

Comments
 (0)