Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add a workflow to try and automatically fixup a PR (#16704)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Cloke <[email protected]>
  • Loading branch information
erikjohnston and clokep authored Nov 29, 2023
1 parent df36696 commit 19dac97
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/fix_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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"

- name: Import order (isort)
continue-on-error: true
run: poetry run isort .

- name: Code style (black)
continue-on-error: true
run: poetry run black .

- name: Semantic checks (ruff)
continue-on-error: true
run: poetry run ruff --fix .

- 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:
commit_message: "Attempt to fix linting"
1 change: 1 addition & 0 deletions changelog.d/16704.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a workflow to try and automatically fixup linting in a PR.

0 comments on commit 19dac97

Please sign in to comment.