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

Commit 19dac97

Browse files
erikjohnstonclokep
andauthored
Add a workflow to try and automatically fixup a PR (#16704)
Co-authored-by: Patrick Cloke <[email protected]>
1 parent df36696 commit 19dac97

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/fix_lint.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# A helper workflow to automatically fixup any linting errors on a PR. Must be
2+
# triggered manually.
3+
4+
name: Attempt to automatically fix linting errors
5+
6+
on:
7+
workflow_dispatch:
8+
9+
jobs:
10+
fixup:
11+
name: Fix up
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@master
20+
with:
21+
# We use nightly so that `fmt` correctly groups together imports, and
22+
# clippy correctly fixes up the benchmarks.
23+
toolchain: nightly-2022-12-01
24+
components: rustfmt
25+
- uses: Swatinem/rust-cache@v2
26+
27+
- name: Setup Poetry
28+
uses: matrix-org/setup-python-poetry@v1
29+
with:
30+
install-project: "false"
31+
32+
- name: Import order (isort)
33+
continue-on-error: true
34+
run: poetry run isort .
35+
36+
- name: Code style (black)
37+
continue-on-error: true
38+
run: poetry run black .
39+
40+
- name: Semantic checks (ruff)
41+
continue-on-error: true
42+
run: poetry run ruff --fix .
43+
44+
- run: cargo clippy --all-features --fix -- -D warnings
45+
continue-on-error: true
46+
47+
- run: cargo fmt
48+
continue-on-error: true
49+
50+
- uses: stefanzweifel/git-auto-commit-action@v5
51+
with:
52+
commit_message: "Attempt to fix linting"

changelog.d/16704.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a workflow to try and automatically fixup linting in a PR.

0 commit comments

Comments
 (0)