summaryrefslogtreecommitdiff
path: root/.github/workflows/format.yml
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
committerDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
commit30aac80d5a6d8c6f7c06efb49189d748e70edc4a (patch)
treeceb11968ae41228e4b110c07467cdca7cc9cff22 /.github/workflows/format.yml
parent67f4e5f34489abf986dedb4984b256692086c615 (diff)
parente22a183329fd05d39f88bb9dfebe98cfa7cd8402 (diff)
Merge remote-tracking branch 'qmk 0.17.0' into firmware21
Diffstat (limited to '.github/workflows/format.yml')
-rw-r--r--.github/workflows/format.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 0000000000..ba0a86aa78
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,51 @@
+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/qmk_cli
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Install dependencies
+ run: |
+ pip3 install -r requirements-dev.txt
+
+ - uses: trilom/file-changes-action@v1.2.4
+ id: file_changes
+ with:
+ output: ' '
+ fileOutput: ' '
+
+ - name: Run qmk formatters
+ shell: 'bash {0}'
+ run: |
+ cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt
+ qmk format-c --core-only $(< ~/files_changed.txt) || true
+ qmk format-python $(< ~/files_changed.txt) || true
+ qmk format-text $(< ~/files_changed.txt) || true
+
+ - name: Fail when formatting required
+ run: |
+ git diff
+ for file in $(git diff --name-only); do
+ echo "File '${file}' Requires Formatting"
+ echo "::error file=${file}::Requires Formatting"
+ done
+ test -z "$(git diff --name-only)"