From 4d99f43c9caf869483eeaa9a2a951dc936325370 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:22:56 -0800 Subject: [PATCH 1/7] clippy: remove useless_vec This currently breaks CI in e.g. https://github.com/gitpatch-rs/gitpatch/actions/runs/20013661647/job/57387162629#step:5:70 --- src/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ast.rs b/src/ast.rs index d923f10..48374c4 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -299,7 +299,7 @@ mod tests { range_hint: "", lines: vec![], }; - for (input, expected) in vec![ + for (input, expected) in [ ("", None), (" ", None), (" ", None), From 64b1c8fe2d60e09cd7bf8ad925142a40e816ec09 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:32:59 -0800 Subject: [PATCH 2/7] Update to actions/checkout@v6 --- .github/workflows/checks.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7a52634..0d0ee1f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -24,8 +24,7 @@ jobs: - 1.87 - stable steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v6 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -51,7 +50,7 @@ jobs: - 1.87 # clippy became more picky after this - stable steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: actions-rs/toolchain@v1 with: profile: minimal From 4bfaa97056fc9011427f3b601afce3758bbd7c0a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:42:54 -0800 Subject: [PATCH 3/7] Use dtolnay/rust-toolchain instead of deprecated actions-rs --- .github/workflows/checks.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0d0ee1f..7560590 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,9 +2,9 @@ name: checks on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # allow manual trigger workflow_dispatch: @@ -24,19 +24,17 @@ jobs: - 1.87 - stable steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{matrix.rust}} - override: true - - - name: Build lib - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Build examples - run: cargo build --example '*' + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@v1 + with: + components: rustfmt, clippy + toolchain: ${{matrix.rust}} + - name: Build lib + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Build examples + run: cargo build --example '*' style: name: Style checks for ${{matrix.rust}} on ${{matrix.os}} @@ -47,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] rust: - 1.84.1 # pre edition2024 - - 1.87 # clippy became more picky after this + - 1.87 # clippy became more picky after this - stable steps: - uses: actions/checkout@v6 From 4de6b20fcfafedea9aa2378f93d3ecc53e39cf4a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:37:19 -0800 Subject: [PATCH 4/7] Fold style checks into the same workers Remove use of deprecated actions-rs --- .github/workflows/checks.yml | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7560590..4ce7475 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,33 +35,7 @@ jobs: run: cargo test --verbose - name: Build examples run: cargo build --example '*' - - style: - name: Style checks for ${{matrix.rust}} on ${{matrix.os}} - runs-on: ${{matrix.os}} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - rust: - - 1.84.1 # pre edition2024 - - 1.87 # clippy became more picky after this - - stable - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{matrix.rust}} - override: true - components: rustfmt, clippy - name: fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets --all-features -- -D warnings + run: cargo clippy --all-targets --all-features -- -D warnings From e502887d71006d365016efe8eea5a63eaa383290 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:45:39 -0800 Subject: [PATCH 5/7] Just build once, including the examples --- .github/workflows/checks.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4ce7475..5103e9a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -30,11 +30,9 @@ jobs: components: rustfmt, clippy toolchain: ${{matrix.rust}} - name: Build lib - run: cargo build --verbose + run: cargo build --verbose --all-targets --all-features - name: Run tests run: cargo test --verbose - - name: Build examples - run: cargo build --example '*' - name: fmt run: cargo fmt --all -- --check - name: clippy From 35bd115558402a5dd0b5b795c146d672c38dcf75 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 17:46:31 -0800 Subject: [PATCH 6/7] Also test on nightly --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 5103e9a..197554c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -23,6 +23,7 @@ jobs: - 1.84.1 # pre edition2024 - 1.87 - stable + - nightly steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@v1 From ddecb0acaa1e1c1a7346f00f473fe03d9907f2cc Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 7 Dec 2025 18:06:47 -0800 Subject: [PATCH 7/7] Declare MSRV 1.63 Seems to be the earliest version that actually builds. --- .github/workflows/checks.yml | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 197554c..b10df3b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -20,6 +20,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: + - 1.63 # MSRV from Cargo.toml - 1.84.1 # pre edition2024 - 1.87 - stable diff --git a/Cargo.toml b/Cargo.toml index f1d99c1..012f09c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ readme = "README.md" keywords = ["patch", "diff", "parse", "nom"] license = "MIT" edition = "2018" +rust-version = "1.63" # matches .github/workflows/checks.yml [dependencies] nom = "7.1.0"