Skip to content

Commit d9acad7

Browse files
committed
chore: improve Makefile, gitignore, and goreleaser changelog
- Inject version from git tags in Makefile build - Add clean and coverage targets to Makefile - Add .DS_Store and coverage.out to .gitignore - Categorize and filter goreleaser changelog
1 parent 1f3e4a9 commit d9acad7

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ dist/
33
demo.tape
44
record-demo.sh
55
.idea/
6+
.DS_Store
7+
coverage.out

.goreleaser.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,16 @@ checksum:
3434

3535
changelog:
3636
sort: asc
37+
filters:
38+
exclude:
39+
- "^chore:"
40+
- "^docs:"
41+
- "^ci:"
42+
- "^test:"
43+
groups:
44+
- title: Bug Fixes
45+
regexp: "^fix:"
46+
- title: Features
47+
regexp: "^feat:"
48+
- title: Other
49+
regexp: ".*"

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
.PHONY: build test lint fmt run
1+
.PHONY: build test lint fmt run clean coverage
2+
3+
VERSION ?= $(shell git describe --tags --always --dirty)
24

35
build:
4-
go build -o ccost ./cmd/ccost
6+
go build -ldflags "-X main.version=$(VERSION)" -o ccost ./cmd/ccost
57

68
test:
79
go test ./...
@@ -13,4 +15,12 @@ fmt:
1315
gofmt -w .
1416

1517
run:
16-
go run ./cmd/ccost
18+
go run ./cmd/ccost
19+
20+
clean:
21+
rm -f ccost
22+
rm -f coverage.out
23+
24+
coverage:
25+
go test -coverprofile=coverage.out ./...
26+
go tool cover -func=coverage.out

0 commit comments

Comments
 (0)