File tree Expand file tree Collapse file tree 4 files changed +62
-0
lines changed
Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ # actionlint configuration
2+ # https://github.com/rhysd/actionlint/blob/main/docs/config.md
Original file line number Diff line number Diff line change 6969 - name : Run style and unused
7070 if : ${{ matrix.go_version == '1.22' }}
7171 run : make style unused
72+
73+ lint :
74+ name : Lint
75+ runs-on : ubuntu-latest
76+ steps :
77+ - name : Checkout code
78+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
79+
80+ - name : Set up Go
81+ 82+ with :
83+ go-version : stable
84+ check-latest : true
85+
86+ - name : Lint YAML files
87+ run : make lint-yaml
88+
89+ - name : Lint GitHub Actions workflows
90+ run : make lint-actions
Original file line number Diff line number Diff line change 1+ # yamlfmt configuration
2+ # https://github.com/google/yamlfmt
3+
4+ doublestar: true
5+
6+ exclude:
7+ - "**/testdata/**"
8+ - "**/*testdata*/**"
9+
10+ gitignore_excludes: true
11+
12+ formatter:
13+ type: basic
14+ indent: 2
15+ include_document_start: false
16+ retain_line_breaks: true
17+ max_line_length: 0
Original file line number Diff line number Diff line change @@ -66,6 +66,30 @@ test-exp:
6666test-exp-short :
6767 cd exp && $(GOTEST ) -short $(GOOPTS ) $(pkgs )
6868
69+ YAMLFMT := $(FIRST_GOPATH ) /bin/yamlfmt
70+ ACTIONLINT := $(FIRST_GOPATH ) /bin/actionlint
71+
72+ $(YAMLFMT ) :
73+ go install github.com/google/yamlfmt/cmd/yamlfmt@latest
74+
75+ $(ACTIONLINT ) :
76+ go install github.com/rhysd/actionlint/cmd/actionlint@latest
77+
78+ .PHONY : format-yaml
79+ format-yaml : $(YAMLFMT )
80+ @echo " >> formatting YAML files"
81+ $(YAMLFMT ) -dstar ' **/*.yml' ' **/*.yaml'
82+
83+ .PHONY : lint-yaml
84+ lint-yaml : $(YAMLFMT )
85+ @echo " >> linting YAML files"
86+ $(YAMLFMT ) -lint -dstar ' **/*.yml' ' **/*.yaml'
87+
88+ .PHONY : lint-actions
89+ lint-actions : $(ACTIONLINT )
90+ @echo " >> linting GitHub Actions workflows"
91+ $(ACTIONLINT )
92+
6993.PHONY : check-crlf
7094check-crlf :
7195 @echo " >> checking for CRLF line endings"
You can’t perform that action at this time.
0 commit comments