fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreAdded additional formatters to CI (#3048)caa8683c

main
1.1 KiB44 linesraw
1name: Formatting
2
3on:
4  push:
5    branches:
6      - main
7  pull_request:
8    types:
9      - opened
10      - synchronize
11
12jobs:
13  code-format-checks:
14    runs-on: ubuntu-latest
15    steps:
16      - uses: actions/checkout@v2
17      - uses: DoozyX/clang-format-lint-action@v0.14
18        with:
19          source: '.'
20          extensions: 'h,c,cc,proto'
21          clangFormatVersion: 14
22      - uses: actionsx/prettier@v2
23        with:
24          args: --config "${{ github.workspace }}/.prettierrc.toml" --write "**/*.{js,ts}"
25      # Prettier has no diff view so we must make one ourselves
26      # https://github.com/prettier/prettier/issues/6885
27      - run: |
28          git diff
29          if [[ -n "$(git status --porcelain)" ]]; then
30            exit 1
31          fi
32      - name: Set up Python
33        uses: actions/setup-python@v2
34        with:
35          python-version: 3.11
36      - name: Install dependencies
37        run: |
38          pip install 'black==24.10.0' 'isort==5.13.2'
39      - name: Run black
40        run: |
41          python -m black --check --diff ./
42      - name: Run isort
43        run: |
44          python -m isort --profile=black --check-only ./