From c1b51d745798172b0ec3679850897726f5b1b771 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 26 May 2025 14:15:38 +0200 Subject: [PATCH] WIP: run `lintcheck --fix` in CI --- .github/workflows/lintcheck.yml | 4 ++-- lintcheck/src/main.rs | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lintcheck.yml b/.github/workflows/lintcheck.yml index 70c805903d36..b17520efca24 100644 --- a/.github/workflows/lintcheck.yml +++ b/.github/workflows/lintcheck.yml @@ -66,7 +66,7 @@ jobs: - name: Run lintcheck if: steps.cache-json.outputs.cache-hit != 'true' - run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml + run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml --fix - name: Upload base JSON uses: actions/upload-artifact@v4 @@ -97,7 +97,7 @@ jobs: run: cargo build --manifest-path=lintcheck/Cargo.toml - name: Run lintcheck - run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml + run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml --fix - name: Upload head JSON uses: actions/upload-artifact@v4 diff --git a/lintcheck/src/main.rs b/lintcheck/src/main.rs index 841838314328..1c36f0345852 100644 --- a/lintcheck/src/main.rs +++ b/lintcheck/src/main.rs @@ -143,7 +143,7 @@ impl Crate { cmd = Command::new("cargo"); } - cmd.arg(if config.fix { "fix" } else { "check" }) + cmd.args(if config.fix { &["fix", "--allow-no-vcs", "--allow-dirty"][..] } else { &["check"][..] }) .arg("--quiet") .current_dir(&self.path) .env("CLIPPY_ARGS", clippy_args.join("__CLIPPY_HACKERY__")) @@ -419,11 +419,6 @@ fn lintcheck(config: LintcheckConfig) { clippy_entries.extend(server_clippy_entries); } - // if we are in --fix mode, don't change the log files, terminate here - if config.fix { - return; - } - // split up warnings and ices let mut warnings: Vec = vec![]; let mut raw_ices: Vec = vec![];