Skip to content

Commit

Permalink
Exclude automatically generated code from coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Jan 7, 2024
1 parent e553eac commit 3526605
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 114 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ clean: ## Clean project
-rm -rf $(S3HUB) $(SPARE) cover.out cover.html

test: ## Start unit test
env GOOS=$(GOOS) $(GO_TEST) -coverpkg=./... -coverprofile=cover.out -cover ./...
env GOOS=$(GOOS) $(GO_TEST) -coverpkg=./... -coverprofile=cover.out.tmp -cover ./...
cat cover.out.tmp | grep -v "_gen.go" | grep -v "main.go" > cover.out
$(GO_TOOL) cover -html=cover.out -o cover.html

coverage-tree: test ## Generate coverage tree
go-cover-treemap -coverprofile cover.out > doc/img/cover.svg
go-cover-treemap -statements -coverprofile cover.out > doc/img/cover.svg

changelog: ## Generate changelog
ghch --format markdown > CHANGELOG.md
Expand Down
Loading

0 comments on commit 3526605

Please sign in to comment.