linting.yml 1018 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: Lint
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. push:
  7. branches:
  8. - main
  9. workflow_dispatch:
  10. jobs:
  11. lint:
  12. name: Lint
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v3
  16. - name: install dependencies
  17. run: |
  18. brew install shellcheck shfmt zsh
  19. pip3 install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc
  20. - name: run mdformat
  21. run: find . -name '*.md' -type f -print0 | xargs -0 -n1 -P4 python3 -m mdformat --check --wrap 120
  22. - name: run shfmt
  23. run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shfmt -bn -ci -d -i 2 -ln bash -s -sr
  24. - name: run shellcheck
  25. run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shellcheck
  26. - name: "run zsh"
  27. run: find . -name '*.zsh' -type f -print0 | xargs -0 -n1 -P4 zsh -n
  28. - name: "run zcompile"
  29. run: find . -name '*.zsh' -type f -exec zsh -fc "zcompile {}" \;