linters.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Linters
  2. permissions: read-all
  3. on:
  4. pull_request:
  5. branches:
  6. - main
  7. workflow_dispatch:
  8. jobs:
  9. jshint:
  10. name: Javascript Linter
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v5
  14. - name: Install linters
  15. run: |
  16. sudo npm install -g jshint@2.13.6 eslint@8.57.0
  17. - name: Run jshint
  18. run: jshint internal/ui/static/js/*.js
  19. - name: Run ESLint
  20. run: eslint internal/ui/static/js/*.js
  21. golangci:
  22. name: Golang Linters
  23. runs-on: ubuntu-latest
  24. steps:
  25. - uses: actions/checkout@v5
  26. - uses: actions/setup-go@v6
  27. with:
  28. go-version: stable
  29. - uses: golangci/golangci-lint-action@v8
  30. with:
  31. args: >
  32. --timeout 10m
  33. --disable errcheck
  34. --enable sqlclosecheck,misspell,whitespace,gocritic
  35. - name: Run gofmt linter
  36. run: gofmt -d -e .
  37. commitlint:
  38. if: github.event_name == 'pull_request'
  39. name: Commit Linter
  40. runs-on: ubuntu-latest
  41. steps:
  42. - uses: actions/checkout@v5
  43. with:
  44. fetch-depth: 0
  45. - name: Set up Python
  46. uses: actions/setup-python@v6
  47. with:
  48. python-version: '3.13'
  49. - name: Validate PR commits
  50. run: python3 .github/workflows/scripts/commit-checker.py --base ${{ github.event.pull_request.base.sha }} --head ${{ github.event.pull_request.head.sha }}