mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 18:45:52 +03:00
7d52ce7d4b
I thought ruff check would also format, but it doesn't. This runs ruff format in CI and dev scripts. The first commit is just a run of `ruff format .` in the root directory.
48 lines
1.2 KiB
YAML
48 lines
1.2 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:
|
|
|
|
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: 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@v5
|
|
with:
|
|
commit_message: "Attempt to fix linting"
|