summaryrefslogtreecommitdiffstats
path: root/.github/workflows/format.yaml
blob: 6d13e78945c7deb8b4c7c4933f60795c95fc6230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: PR Lint Format

on:
  pull_request:
    paths:
    - 'drivers/**'
    - 'lib/arm_atsam/**'
    - 'lib/lib8tion/**'
    - 'lib/python/**'
    - 'platforms/**'
    - 'quantum/**'
    - 'tests/**'
    - 'tmk_core/**'

jobs:
  lint:
    runs-on: ubuntu-latest

    container: qmkfm/base_container

    steps:
    - uses: rlespinasse/github-slug-action@v3.x

    - uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - uses: trilom/file-changes-action@v1.2.4
      id: file_changes
      with:
        output: ' '
        fileOutput: ' '

    - name: Run qmk cformat and qmk pyformat
      shell: 'bash {0}'
      run: |
        qmk cformat -n $(< ~/files.txt)
        cformat_exit=$?
        qmk pyformat -n
        pyformat_exit=$?

        exit $((cformat_exit + pyformat_exit))