Skip to content

Commit c1b51d7

Browse files
committed
WIP: run lintcheck --fix in CI
1 parent 32a3744 commit c1b51d7

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.github/workflows/lintcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Run lintcheck
6868
if: steps.cache-json.outputs.cache-hit != 'true'
69-
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
69+
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml --fix
7070

7171
- name: Upload base JSON
7272
uses: actions/upload-artifact@v4
@@ -97,7 +97,7 @@ jobs:
9797
run: cargo build --manifest-path=lintcheck/Cargo.toml
9898

9999
- name: Run lintcheck
100-
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
100+
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml --fix
101101

102102
- name: Upload head JSON
103103
uses: actions/upload-artifact@v4

lintcheck/src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl Crate {
143143
cmd = Command::new("cargo");
144144
}
145145

146-
cmd.arg(if config.fix { "fix" } else { "check" })
146+
cmd.args(if config.fix { &["fix", "--allow-no-vcs", "--allow-dirty"][..] } else { &["check"][..] })
147147
.arg("--quiet")
148148
.current_dir(&self.path)
149149
.env("CLIPPY_ARGS", clippy_args.join("__CLIPPY_HACKERY__"))
@@ -419,11 +419,6 @@ fn lintcheck(config: LintcheckConfig) {
419419
clippy_entries.extend(server_clippy_entries);
420420
}
421421

422-
// if we are in --fix mode, don't change the log files, terminate here
423-
if config.fix {
424-
return;
425-
}
426-
427422
// split up warnings and ices
428423
let mut warnings: Vec<ClippyWarning> = vec![];
429424
let mut raw_ices: Vec<RustcIce> = vec![];

0 commit comments

Comments
 (0)