mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-12 12:51:18 +00:00
cd50fdf7ee
* Add diff logic to python format subcommand * Update test * Add in filter per format-c * fix tests * Update new workflow
50 lines
1.0 KiB
YAML
50 lines
1.0 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:
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y dos2unix
|
|
|
|
- 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 formatters
|
|
shell: 'bash {0}'
|
|
run: |
|
|
qmk format-c --core-only $(< ~/files.txt)
|
|
qmk format-python $(< ~/files.txt)
|
|
qmk format-text $(< ~/files.txt)
|
|
git diff
|
|
|
|
- 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)"
|