-
Notifications
You must be signed in to change notification settings - Fork 19
38 lines (38 loc) · 1.12 KB
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: format
on: [pull_request, workflow_dispatch]
jobs:
lua:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check formatting
uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
go:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: Run gci
run: |
go install github.com/daixiang0/gci@latest
gci write --skip-generated --skip-vendor -s standard -s default .
working-directory: ./tests/go
- name: Run golines
run: |
go install mvdan.cc/gofumpt@latest
go install github.com/segmentio/golines@latest
golines --base-formatter=gofumpt --ignore-generated --tab-len=1 --max-len=120 --write-output .
working-directory: ./tests/go
- name: Check git diff
run: |
git diff --exit-code
working-directory: ./tests/go