format.yaml 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: format
  2. on:
  3. push:
  4. branches: '**'
  5. pull_request:
  6. branches:
  7. - 'master'
  8. - 'rolling'
  9. jobs:
  10. stylua-check:
  11. name: "Formatting check with Stylua"
  12. runs-on: ubuntu-20.04
  13. steps:
  14. - uses: actions/checkout@v2
  15. - name: Prepare dependencies
  16. run: |
  17. sudo apt install -y curl unzip --no-install-recommends
  18. bash ./utils/installer/install_stylua.sh
  19. - name: Check formatting
  20. run: |
  21. ./utils/stylua --config-path .stylua.toml -c .
  22. shfmt-check:
  23. name: "Formatting check with shfmt"
  24. runs-on: ubuntu-20.04
  25. steps:
  26. - uses: actions/checkout@v2
  27. - name: Setup Go
  28. uses: actions/setup-go@v2
  29. with:
  30. go-version: '1.16'
  31. - name: Use shfmt
  32. run: |
  33. GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
  34. # https://google.github.io/styleguide/shellguide.html
  35. - name: Check formatting
  36. run: |
  37. shfmt -f . | grep -v jdtls | xargs shfmt -i 2 -ci -l -d