Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Commit

Permalink
Provide task runner
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jun 16, 2023
1 parent 0383e3b commit 38fc688
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"cSpell.words": [
"cachix",
"cmds",
"dprint",
"nixos",
"nixpkgs"
Expand Down
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
> nix-shell
(prepared bash)

> go version
go version go1.20.4 linux/amd64
> task
task: [build] go build -ldflags "-X main.revision=$(git rev-parse --short HEAD)"
task: [fmt] dprint fmt
task: [lint] dprint check
task: [lint] go vet
task: [fmt] go fmt
task: [lint] actionlint

> dprint --version
dprint 0.36.1

> go build -ldflags "-X main.revision=$(git rev-parse --short HEAD)"
> ./nix-headbump --version
0.1.0(ceaa32d)
```
23 changes: 23 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://taskfile.dev

version: '3'

tasks:
default:
deps:
- task: fmt
- task: lint
- task: build
build:
cmds:
- go build -ldflags "-X main.revision=$(git rev-parse --short HEAD)"
fmt:
cmds:
- dprint fmt
- go fmt
lint:
# go fmt does not have option for no effect - https://github.com/golang/go/issues/41189
cmds:
- dprint check
- go vet
- actionlint
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ pkgs.mkShell {
pkgs.nixpkgs-fmt
pkgs.dprint
pkgs.actionlint
pkgs.go-task
];
}

0 comments on commit 38fc688

Please sign in to comment.