2021-05-10 18:18:44 +00:00
|
|
|
name: PR Lint Format
|
2020-12-10 17:01:51 +00:00
|
|
|
|
|
|
|
on:
|
2021-05-10 18:18:44 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'drivers/**'
|
|
|
|
- 'lib/arm_atsam/**'
|
|
|
|
- 'lib/lib8tion/**'
|
|
|
|
- 'lib/python/**'
|
|
|
|
- 'platforms/**'
|
|
|
|
- 'quantum/**'
|
|
|
|
- 'tests/**'
|
|
|
|
- 'tmk_core/**'
|
2020-12-10 17:01:51 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-05-10 18:18:44 +00:00
|
|
|
lint:
|
2020-12-10 17:01:51 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2021-08-29 23:41:56 +00:00
|
|
|
container: qmkfm/qmk_cli
|
2020-12-10 17:01:51 +00:00
|
|
|
|
|
|
|
steps:
|
2021-11-14 23:06:22 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
apt-get update && apt-get install -y dos2unix
|
2021-02-14 19:51:07 +00:00
|
|
|
|
2020-12-10 17:01:51 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-12-16 23:00:02 +00:00
|
|
|
with:
|
2021-05-10 18:18:44 +00:00
|
|
|
fetch-depth: 0
|
2020-12-10 17:01:51 +00:00
|
|
|
|
2021-05-10 18:18:44 +00:00
|
|
|
- uses: trilom/file-changes-action@v1.2.4
|
|
|
|
id: file_changes
|
|
|
|
with:
|
|
|
|
output: ' '
|
|
|
|
fileOutput: ' '
|
2020-12-10 17:01:51 +00:00
|
|
|
|
2021-11-14 23:06:22 +00:00
|
|
|
- name: Run qmk formatters
|
2021-05-10 18:18:44 +00:00
|
|
|
shell: 'bash {0}'
|
2021-02-06 12:55:50 +00:00
|
|
|
run: |
|
2021-11-14 23:06:22 +00:00
|
|
|
qmk format-c --core-only $(< ~/files.txt)
|
2021-11-17 23:02:45 +00:00
|
|
|
qmk format-python $(< ~/files.txt)
|
2021-11-14 23:06:22 +00:00
|
|
|
qmk format-text $(< ~/files.txt)
|
|
|
|
git diff
|
2021-02-06 12:55:50 +00:00
|
|
|
|
2021-11-14 23:06:22 +00:00
|
|
|
- name: Fail when formatting required
|
|
|
|
run: |
|
|
|
|
for file in $(git diff --name-only); do
|
|
|
|
echo "::error file=${file}::::File Requires Formatting"
|
|
|
|
done
|
|
|
|
test -z "$(git diff --name-only)"
|