You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

  1. name: PR Lint Format
  2. on:
  3. pull_request:
  4. paths:
  5. - 'drivers/**'
  6. - 'lib/arm_atsam/**'
  7. - 'lib/lib8tion/**'
  8. - 'lib/python/**'
  9. - 'platforms/**'
  10. - 'quantum/**'
  11. - 'tests/**'
  12. - 'tmk_core/**'
  13. jobs:
  14. lint:
  15. runs-on: ubuntu-latest
  16. container: qmkfm/qmk_cli
  17. steps:
  18. - uses: actions/checkout@v3
  19. with:
  20. fetch-depth: 0
  21. - name: Install dependencies
  22. run: |
  23. pip3 install -r requirements-dev.txt
  24. - uses: trilom/file-changes-action@v1.2.4
  25. id: file_changes
  26. with:
  27. output: ' '
  28. fileOutput: ' '
  29. - name: Run qmk formatters
  30. shell: 'bash {0}'
  31. run: |
  32. cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt
  33. qmk format-c --core-only $(< ~/files_changed.txt) || true
  34. qmk format-python $(< ~/files_changed.txt) || true
  35. qmk format-text $(< ~/files_changed.txt) || true
  36. - name: Fail when formatting required
  37. run: |
  38. git diff
  39. for file in $(git diff --name-only); do
  40. echo "File '${file}' Requires Formatting"
  41. echo "::error file=${file}::Requires Formatting"
  42. done
  43. test -z "$(git diff --name-only)"