opensteno_qmk/.github/workflows/format.yml
dependabot[bot] 58f4e19503
Bump actions/checkout from 2 to 3 (#17496)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-29 16:44:54 +10:00

51 lines
1.2 KiB
YAML

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@v3
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)"