Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 1.57 KB

File metadata and controls

98 lines (70 loc) · 1.57 KB

Matcher dialect

Keys are token patterns. First matching key (definition order) wins.

Specific before general

version: "0.1"
engine:
  dialect: matcher

scripts:
  test ${MODULE}: go test ./${godo:argv[MODULE]}/...
  test: go test ./...
godo --preview test internal/catalog

Prints (MODULE = internal/catalog):

go test ./internal/catalog/...
godo --preview test

Prints (falls through to the exact key):

go test ./...

Captures in @deps

scripts:
  lint ${MODULE}: go run ./lint ${godo:argv[MODULE]}
  # @deps lint ${MODULE}
  test ${MODULE}: go test ./${godo:argv[MODULE]}/...
godo --preview test internal/catalog

Prints:

go run ./lint internal/catalog
go test ./internal/catalog/...

Override one script (file stays package)

version: "0.1"

scripts:
  # @dialect matcher
  "run ${GRP} ${SCR}": go run ./scripts/${godo:argv[GRP]}/${godo:argv[SCR]} ${godo:args}
godo --ls run _ _

Prints:

@dialect matcher
run ${GRP} ${SCR}:
  go run ./scripts/${godo:argv[GRP]}/${godo:argv[SCR]} ${godo:args}
godo --preview run api seed --verbose

Prints:

go run ./scripts/api/seed --verbose

Leftover tokens

After the pattern matches, leftovers feed ${godo:args…}. If the body does not use them and leftovers remain, godo errors (same rule as package).

Next