2023-11-29 07:07:32 -07:00
|
|
|
# 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:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
fixup:
|
|
|
|
name: Fix up
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@master
|
|
|
|
with:
|
|
|
|
# We use nightly so that `fmt` correctly groups together imports, and
|
|
|
|
# clippy correctly fixes up the benchmarks.
|
|
|
|
toolchain: nightly-2022-12-01
|
|
|
|
components: rustfmt
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
|
|
|
|
- name: Setup Poetry
|
|
|
|
uses: matrix-org/setup-python-poetry@v1
|
|
|
|
with:
|
|
|
|
install-project: "false"
|
|
|
|
|
2024-09-02 05:39:04 -06:00
|
|
|
- name: Run ruff check
|
2023-11-29 07:07:32 -07:00
|
|
|
continue-on-error: true
|
2024-08-30 02:07:46 -06:00
|
|
|
run: poetry run ruff check --fix .
|
2023-11-29 07:07:32 -07:00
|
|
|
|
2024-09-02 05:39:04 -06:00
|
|
|
- name: Run ruff format
|
|
|
|
continue-on-error: true
|
|
|
|
run: poetry run ruff format --quiet .
|
|
|
|
|
2023-11-29 07:07:32 -07:00
|
|
|
- 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@v5
|
|
|
|
with:
|
2024-08-30 02:07:46 -06:00
|
|
|
commit_message: "Attempt to fix linting"
|