53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
# A helper workflow to automatically fixup any linting errors on a PR. Must be
|
|
# triggered manually.
|
|
|
|
name: Attempt to automatically fix linting errors
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
# We use nightly so that `fmt` correctly groups together imports, and
|
|
# clippy correctly fixes up the benchmarks.
|
|
RUST_VERSION: nightly-2025-06-24
|
|
|
|
jobs:
|
|
fixup:
|
|
name: Fix up
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
|
|
with:
|
|
toolchain: ${{ env.RUST_VERSION }}
|
|
components: clippy, rustfmt
|
|
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
|
|
|
- name: Setup Poetry
|
|
uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
|
|
with:
|
|
install-project: "false"
|
|
poetry-version: "2.1.1"
|
|
|
|
- name: Run ruff check
|
|
continue-on-error: true
|
|
run: poetry run ruff check --fix .
|
|
|
|
- name: Run ruff format
|
|
continue-on-error: true
|
|
run: poetry run ruff format --quiet .
|
|
|
|
- run: cargo clippy --all-features --fix -- -D warnings
|
|
continue-on-error: true
|
|
|
|
- run: cargo fmt
|
|
continue-on-error: true
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
|
|
with:
|
|
commit_message: "Attempt to fix linting"
|