whitespace_checks.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: whitespace_checks
  2. # Check whitespaces of the following file types
  3. # Not checked: .lua, .yml, .properties, .conf, .java, .py, .svg, .gradle, .xml, ...
  4. # (luacheck already checks .lua files)
  5. on:
  6. push:
  7. paths:
  8. - '**.txt'
  9. - '**.md'
  10. - '**.[ch]'
  11. - '**.cpp'
  12. - '**.hpp'
  13. - '**.sh'
  14. - '**.cmake'
  15. - '**.glsl'
  16. pull_request:
  17. paths:
  18. - '**.txt'
  19. - '**.md'
  20. - '**.[ch]'
  21. - '**.cpp'
  22. - '**.hpp'
  23. - '**.sh'
  24. - '**.cmake'
  25. - '**.glsl'
  26. jobs:
  27. trailing_whitespaces:
  28. runs-on: ubuntu-latest
  29. steps:
  30. - uses: actions/checkout@v4
  31. # Line endings are already ensured by .gitattributes
  32. - name: Check trailing whitespaces
  33. run: if git ls-files | grep -E '\.txt$|\.md$|\.[ch]$|\.cpp$|\.hpp$|\.sh$|\.cmake$|\.glsl$' | xargs grep -n '\s$'; then echo -e "\033[0;31mFound trailing whitespace"; (exit 1); else (exit 0); fi
  34. tabs_lua_api_files:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v4
  38. # Some files should not contain tabs
  39. - name: Check tabs in Lua API files
  40. run: if grep -n $'\t' doc/lua_api.md doc/client_lua_api.md; then echo -e "\033[0;31mFound tab in markdown file"; (exit 1); else (exit 0); fi