Skip to content

Commit

Permalink
Add lint-yaml (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoswitch authored May 10, 2024
1 parent 047a0d4 commit 5a4b64f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ jobs:
**/go.sum
versions.go
- name: run checks
run: go run build check
- name: run lints
if: startsWith(matrix.os, 'ubuntu-')
run: go run build -v lint

- name: run tests
run: go run build -v test
4 changes: 4 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rules:
document-start: disable
truthy:
check-keys: false
20 changes: 17 additions & 3 deletions standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,28 @@ func DefineTasks(opts ...Option) {
},
})

lint := goyek.Define(goyek.Task{
Name: "lint",
Usage: "Lints the code.",
lintGo := goyek.Define(goyek.Task{
Name: "lint-go",
Usage: "Lints Go code.",
Action: func(a *goyek.A) {
cmd.Exec(a, fmt.Sprintf("go run github.com/golangci/golangci-lint/cmd/golangci-lint@%s run --timeout=20m", verGolangCILint))
},
})

lintYaml := goyek.Define(goyek.Task{
Name: "lint-yaml",
Usage: "Lints Yaml code.",
Action: func(a *goyek.A) {
cmd.Exec(a, fmt.Sprintf("go run github.com/wasilibs/go-yamllint/cmd/yamllint@%s .", verGoYamllint))
},
})

lint := goyek.Define(goyek.Task{
Name: "lint",
Usage: "Lints code in various languages.",
Deps: goyek.Deps{lintGo, lintYaml},
})

test := goyek.Define(goyek.Task{
Name: "test",
Usage: "Runs unit tests.",
Expand Down
1 change: 1 addition & 0 deletions versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ const (
verGolangCILint = "v1.58.1"
verGosImports = "v0.3.8"
verGoFumpt = "v0.6.0"
verGoYamllint = "v1.35.1"
)

0 comments on commit 5a4b64f

Please sign in to comment.