-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3492274
commit 4eb192e
Showing
3 changed files
with
69 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,37 @@ | ||
version: '3' | ||
|
||
vars: | ||
NPX: | ||
sh: which -a bunx npx | grep -v "not found" | head -n 1 | ||
includes: | ||
buf: | ||
taskfile: ./taskfiles/buf.yml | ||
go: | ||
taskfile: ./taskfiles/golang.yml | ||
|
||
tasks: | ||
generate: | ||
aliases: | ||
- gen | ||
desc: "Generate code (e.g., protobufs)" | ||
deps: | ||
- gen-buf | ||
|
||
gen-buf: | ||
internal: true | ||
desc: "Generate protobufs" | ||
cmds: | ||
- buf generate | ||
- buf:gen | ||
|
||
lint: | ||
desc: "Lints the code" | ||
deps: | ||
- lint-buf | ||
- lint-go | ||
|
||
lint-buf: | ||
deps: | ||
- format | ||
cmds: | ||
- buf lint | ||
- buf format -w | ||
|
||
lint-go: | ||
deps: | ||
- format | ||
cmds: | ||
- golangci-lint run --verbose | ||
- buf:lint | ||
- go:lint | ||
|
||
format: | ||
aliases: [fmt] | ||
run: once | ||
desc: "Formats all code" | ||
deps: | ||
- fmt-go | ||
- buf:fmt | ||
- go:fmt | ||
- fmt-md | ||
|
||
fmt-md: | ||
run: once | ||
internal: true | ||
desc: "Format Markdown" | ||
cmds: | ||
- "{{.NPX}} prettier --write \"**/*.md\" --prose-wrap always" | ||
|
||
fmt-go: | ||
run: once | ||
internal: true | ||
desc: "Format Golang" | ||
cmds: | ||
- task: gofumpt | ||
- task: gci | ||
|
||
gofumpt: | ||
run: once | ||
internal: true | ||
desc: "Format Go code" | ||
cmds: | ||
- "go install mvdan.cc/gofumpt@latest" | ||
- "gofumpt -l -w ." | ||
|
||
gci: | ||
run: once | ||
internal: true | ||
desc: "Format Go imports" | ||
cmds: | ||
- | | ||
go install github.com/daixiang0/gci@latest ; \ | ||
gci write --skip-generated \ | ||
-s standard \ | ||
-s default \ | ||
-s "prefix(github.com/kevinmichaelchen/temporal-saga-grpc)" \ | ||
. | ||
- "pkgx bunx prettier --write \"**/*.md\" --prose-wrap always" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '3' | ||
|
||
tasks: | ||
gen: | ||
run: once | ||
aliases: | ||
- generate | ||
internal: true | ||
desc: "Generate protobufs" | ||
cmd: pkgx buf@latest generate | ||
|
||
format: | ||
run: once | ||
aliases: | ||
- fmt | ||
cmd: pkgx buf@latest format -w | ||
|
||
lint: | ||
run: once | ||
deps: | ||
- format | ||
cmd: pkgx buf@latest lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3' | ||
|
||
tasks: | ||
lint: | ||
run: once | ||
deps: | ||
- format | ||
cmd: pkgx golangci-lint@latest run --verbose | ||
|
||
fmt: | ||
aliases: | ||
- format | ||
run: once | ||
internal: true | ||
desc: "Format Golang" | ||
cmds: | ||
- task: gofumpt | ||
- task: gci | ||
|
||
gofumpt: | ||
run: once | ||
internal: true | ||
desc: "Format Go code" | ||
cmd: "pkgx gofumpt@latest -l -w ." | ||
|
||
gci: | ||
run: once | ||
internal: true | ||
desc: "Format Go imports" | ||
cmds: | ||
- | | ||
pkgx gci@latest write --skip-generated \ | ||
-s standard \ | ||
-s default \ | ||
-s "prefix(github.com/kevinmichaelchen/temporal-saga-grpc)" \ | ||
. |