logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

format.yml (1422B)


  1. name: PR Lint Format
  2. permissions:
  3. contents: read
  4. on:
  5. pull_request:
  6. paths:
  7. - 'drivers/**'
  8. - 'lib/arm_atsam/**'
  9. - 'lib/lib8tion/**'
  10. - 'lib/python/**'
  11. - 'modules/**'
  12. - 'platforms/**'
  13. - 'quantum/**'
  14. - 'tests/**'
  15. - 'tmk_core/**'
  16. jobs:
  17. lint:
  18. runs-on: ubuntu-latest
  19. container: ghcr.io/qmk/qmk_cli
  20. steps:
  21. - name: Disable safe.directory check
  22. run : git config --global --add safe.directory '*'
  23. - uses: actions/checkout@v4
  24. with:
  25. fetch-depth: 0
  26. - name: Install dependencies
  27. run: |
  28. pip3 install -r requirements-dev.txt
  29. - name: Get changed files
  30. id: file_changes
  31. uses: tj-actions/changed-files@v46
  32. with:
  33. use_rest_api: true
  34. - name: Run qmk formatters
  35. shell: 'bash {0}'
  36. run: |
  37. echo '${{ steps.file_changes.outputs.added_files}}' '${{ steps.file_changes.outputs.modified_files}}' > ~/files_changed.txt
  38. qmk format-c --core-only $(< ~/files_changed.txt) || true
  39. qmk format-python $(< ~/files_changed.txt) || true
  40. qmk format-text $(< ~/files_changed.txt) || true
  41. - name: Fail when formatting required
  42. run: |
  43. git diff
  44. for file in $(git diff --name-only); do
  45. echo "File '${file}' Requires Formatting"
  46. echo "::error file=${file}::Requires Formatting"
  47. done
  48. test -z "$(git diff --name-only)"