lint.yml

 1---
 2name: lint
 3
 4on:
 5  workflow_call:
 6
 7permissions: {}
 8
 9defaults:
10  run:
11    shell: bash
12
13jobs:
14  check-formatting:
15    runs-on: ubuntu-latest
16    timeout-minutes: 3
17    steps:
18      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19        with:
20          persist-credentials: false
21
22      - uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
23
24      - name: Check that files are formatted
25        run: |-
26          if ! nix-build ci --no-out-link -A checks.fmt; then
27            printf "%s\n%s\n\t%s\n\t%s\n%s\n%s\n" \
28              "One or more files are not formatted correctly."
29              "Please run the formatter by changing to the root directory and running one of:"
30              "nix-shell --run treefmt"
31              "nix develop --command treefmt"
32              "Make sure your branch is up to date with trunk; rebase if not."
33              "If you're having trouble, please reach out on matrix at #git-bug-general:matrix.org."
34            exit 1
35          fi