forked from mirrors/qmk_firmware
f7cf066e0f
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 37 to 38. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v37...v38) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
name: PR Lint Format
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'drivers/**'
|
|
- 'lib/arm_atsam/**'
|
|
- 'lib/lib8tion/**'
|
|
- 'lib/python/**'
|
|
- 'platforms/**'
|
|
- 'quantum/**'
|
|
- 'tests/**'
|
|
- 'tmk_core/**'
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
container: ghcr.io/qmk/qmk_cli
|
|
|
|
steps:
|
|
- name: Disable safe.directory check
|
|
run : git config --global --add safe.directory '*'
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip3 install -r requirements-dev.txt
|
|
|
|
- name: Get changed files
|
|
id: file_changes
|
|
uses: tj-actions/changed-files@v38
|
|
|
|
- name: Run qmk formatters
|
|
shell: 'bash {0}'
|
|
run: |
|
|
echo '${{ steps.file_changes.outputs.added_files}}' '${{ steps.file_changes.outputs.modified_files}}' > ~/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)"
|