fix_lint.yaml 1.3 KB

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