Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 14 additions & 42 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: checks

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
# allow manual trigger
workflow_dispatch:

Expand All @@ -20,51 +20,23 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust:
- 1.71 # MSRV from Cargo.toml
- 1.84.1 # pre edition2024
- 1.87
- stable
- nightly
steps:
- uses: actions/checkout@v2

- 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 '*'

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@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.rust}}
override: true
components: rustfmt, clippy
toolchain: ${{matrix.rust}}
- name: Build lib
run: cargo build --verbose --all-targets --all-features
- name: Run tests
run: cargo test --verbose
- 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
if: ${{ matrix.rust == 'stable' }} # to avoid churn about lints being unknown etc
run: cargo clippy --all-targets --all-features -- -D warnings
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ repository = "https://github.com/gitpatch-rs/gitpatch"
readme = "README.md"
keywords = ["patch", "diff", "parse", "nom"]
license = "MIT"
edition = "2018"
edition = "2021"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mindful of updating the edition as I've been bitten by packages pushing mindlessly forward interfering with (embedded) platforms with limitations keeping rust versions older, which is why I kept it back.

Its probably time to move on though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I wouldn't want to move forward unnecessarily. However it seems that the oldest compiler that works with our dependencies also supports 2021, and it's from June 2021.

rust-version = "1.71" # matches .github/workflows/checks.yml

[dependencies]
nom = "7.1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ mod tests {
range_hint: "",
lines: vec![],
};
for (input, expected) in vec![
for (input, expected) in [
("", None),
(" ", None),
(" ", None),
Expand Down