Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.1.2 #123

Merged
merged 31 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
57e2319
Bump github.com/essentialkaos/ek/v12 from 12.113.1 to 12.114.0
dependabot[bot] Apr 4, 2024
096c217
Merge pull request #106 from essentialkaos/dependabot/go_modules/deve…
andyone Apr 4, 2024
ce0f3a0
Bump golang.org/x/tools from 0.19.0 to 0.20.0
dependabot[bot] Apr 5, 2024
3452215
Merge pull request #107 from essentialkaos/dependabot/go_modules/deve…
andyone Apr 5, 2024
bacdfcb
Bump github.com/essentialkaos/ek/v12 from 12.114.0 to 12.116.0
dependabot[bot] Apr 23, 2024
2fcdf7a
Merge pull request #109 from essentialkaos/dependabot/go_modules/deve…
andyone Apr 24, 2024
2f33251
Bump github.com/essentialkaos/ek/v12 from 12.116.0 to 12.121.0
dependabot[bot] May 3, 2024
495c7e8
Merge pull request #112 from essentialkaos/dependabot/go_modules/deve…
andyone May 3, 2024
8a69f25
Bump github.com/essentialkaos/ek/v12 from 12.121.0 to 12.122.0
dependabot[bot] May 6, 2024
84dcee0
Merge pull request #113 from essentialkaos/dependabot/go_modules/deve…
andyone May 6, 2024
47110ef
Bump github.com/essentialkaos/ek/v12 from 12.122.0 to 12.123.2
dependabot[bot] May 8, 2024
8b0c9d8
Merge pull request #116 from essentialkaos/dependabot/go_modules/deve…
andyone May 8, 2024
2aeb143
Bump golang.org/x/tools from 0.20.0 to 0.21.0
dependabot[bot] May 8, 2024
d54f759
Merge pull request #114 from essentialkaos/dependabot/go_modules/deve…
andyone May 8, 2024
68576c9
Bump github.com/essentialkaos/ek/v12 from 12.123.2 to 12.124.0
dependabot[bot] May 13, 2024
2c53a0b
Merge pull request #117 from essentialkaos/dependabot/go_modules/deve…
andyone May 13, 2024
4102ae3
---
dependabot[bot] May 21, 2024
6d251ca
Merge pull request #118 from essentialkaos/dependabot/go_modules/deve…
andyone May 21, 2024
88fd5aa
Bump github.com/essentialkaos/ek/v12 from 12.125.0 to 12.125.1
dependabot[bot] Jun 4, 2024
fd37264
Merge pull request #119 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 4, 2024
232066d
Bump golang.org/x/tools from 0.21.0 to 0.22.0
dependabot[bot] Jun 5, 2024
65f8631
Merge pull request #120 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 5, 2024
0a49333
Improve README
andyone Jun 8, 2024
9b5354e
Bump github.com/essentialkaos/ek/v12 from 12.125.1 to 12.126.0
dependabot[bot] Jun 11, 2024
492514f
Merge pull request #121 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 11, 2024
50ec4d0
Bump github.com/essentialkaos/ek/v12 from 12.126.0 to 12.126.1
dependabot[bot] Jun 13, 2024
30587be
Merge pull request #122 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 13, 2024
d063937
Improve dependabot configuration
andyone Jun 14, 2024
0bde58b
Regenerate Makefile with the latest version of gomakegen
andyone Jun 14, 2024
cd601e6
Improve README
andyone Jun 14, 2024
015e6bb
Dependencies update
andyone Jun 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ updates:
- "andyone"
reviewers:
- "andyone"
groups:
all:
applies-to: version-updates
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
Expand Down
1 change: 1 addition & 0 deletions .github/images/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions .github/images/usage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 39 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
################################################################################

# This Makefile generated by GoMakeGen 2.2.0 using next command:
# This Makefile generated by GoMakeGen 3.0.2 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen

################################################################################

export GO111MODULE=on

ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

COMPAT ?= 1.19
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)

################################################################################

.DEFAULT_GOAL := help
.PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help
.PHONY = fmt vet all install uninstall clean deps update init vendor mod-init mod-update mod-download mod-vendor help

################################################################################

all: htmlcov ## Build all binaries

htmlcov:
go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" htmlcov.go
@echo "Building htmlcov…"
@go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" htmlcov.go

install: ## Install all binaries
cp htmlcov /usr/bin/htmlcov
@echo "Installing binaries…"
@cp htmlcov /usr/bin/htmlcov

uninstall: ## Uninstall all binaries
rm -f /usr/bin/htmlcov
@echo "Removing installed binaries…"
@rm -f /usr/bin/htmlcov

init: mod-init ## Initialize new module

Expand All @@ -43,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions
vendor: mod-vendor ## Make vendored copy of dependencies

mod-init:
@echo "[1/2] Modules initialization…"
ifdef MODULE_PATH ## Module path for initialization (String)
go mod init $(MODULE_PATH)
@go mod init $(MODULE_PATH)
else
go mod init
@go mod init
endif

@echo "[2/2] Dependencies cleanup…"
ifdef COMPAT ## Compatible Go version (String)
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
else
go mod tidy $(VERBOSE_FLAG)
@go mod tidy $(VERBOSE_FLAG)
endif

mod-update:
@echo "[1/4] Updating dependencies…"
ifdef UPDATE_ALL ## Update all dependencies (Flag)
go get -u $(VERBOSE_FLAG) all
@go get -u $(VERBOSE_FLAG) all
else
go get -u $(VERBOSE_FLAG) ./...
@go get -u $(VERBOSE_FLAG) ./...
endif

@echo "[2/4] Stripping toolchain info…"
@grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :

@echo "[3/4] Dependencies cleanup…"
ifdef COMPAT
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
else
go mod tidy $(VERBOSE_FLAG)
@go mod tidy $(VERBOSE_FLAG)
endif

test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
@echo "[4/4] Updating vendored dependencies…"
@test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

mod-download:
go mod download
@echo "Downloading dependencies…"
@go mod download

mod-vendor:
rm -rf vendor && go mod vendor $(VERBOSE_FLAG)
@echo "Vendoring dependencies…"
@rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;
@echo "Formatting sources…"
@find . -name "*.go" -exec gofmt -s -w {} \;

vet: ## Runs 'go vet' over sources
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
@echo "Running 'go vet' over sources…"
@go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...

clean: ## Remove generated files
rm -f htmlcov
@echo "Removing built binaries…"
@rm -f htmlcov

help: ## Show this info
@echo -e '\n\033[1mTargets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s\033[0m %s\n", $$1, $$2}'
@echo -e '\n\033[1mVariables:\033[0m\n'
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
| sed 's/ifdef //' \
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 2.2.0\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n'

################################################################################
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<p align="center"><a href="#readme"><img src="https://gh.kaos.st/htmlcov.svg"/></a></p>
<p align="center"><a href="#readme"><img src=".github/images/card.svg"/></a></p>

<p align="center">
<a href="https://kaos.sh/w/htmlcov/ci"><img src="https://kaos.sh/w/htmlcov/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/htmlcov"><img src="https://kaos.sh/r/htmlcov.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/b/htmlcov"><img src="https://kaos.sh/b/876db5da-5b7e-4ad9-82c0-f347aac10dc2.svg" alt="Codebeat badge" /></a>
<a href="https://kaos.sh/w/htmlcov/codeql"><img src="https://kaos.sh/w/htmlcov/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="#license"><img src="https://gh.kaos.st/apache2.svg"></a>
<a href="#license"><img src=".github/images/license.svg"/></a>
</p>

<p align="center"><a href="#installation">Installation</a> • <a href="#command-line-completion">Command-line completion</a> • <a href="#man-documentation">Man documentation</a> • <a href="#usage">Usage</a> • <a href="#ci-status">CI Status</a> • <a href="#contributing">Contributing</a> • <a href="#license">License</a></p>
Expand All @@ -14,9 +14,9 @@

`htmlcov` is an utility for converting Go coverage profiles into HTML pages. It's just better version of `go tool cover -html=cover.out -o coverage.html` command.

![Screenshot](https://gh.kaos.st/htmlcov1.png)
![Screenshot](.github/images/screenshot1.png)

![Screenshot](https://gh.kaos.st/htmlcov2.png)
![Screenshot](.github/images/screenshot2.png)

### Installation

Expand Down Expand Up @@ -65,25 +65,7 @@ htmlcov --generate-man | sudo gzip > /usr/share/man/man1/htmlcov.1.gz

### Usage

```
Usage: htmlcov {options} coverage-file

Options

--output, -o file Output file (default: coverage.html)
--remove, -R Delete input file after successful generation
--no-color, -nc Disable colors in output
--help, -h Show this help message
--version, -v Show version

Examples

go test -coverprofile=cover.out ./... && htmlcov cover.out
Create coverage profile and convert it to HTML

go test -coverprofile=cover.out ./... && htmlcov -R -o report.html cover.out
Create coverage profile and convert it to HTML, save as report.html and remove profile
```
<p align="center"><img src=".github/images/usage.svg"/></p>

### CI Status

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/essentialkaos/htmlcov
go 1.18

require (
github.com/essentialkaos/ek/v12 v12.113.1
golang.org/x/tools v0.19.0
github.com/essentialkaos/ek/v12 v12.127.0
golang.org/x/tools v0.22.0
)

require (
github.com/essentialkaos/depsy v1.1.0 // indirect
golang.org/x/sys v0.18.0 // indirect
github.com/essentialkaos/depsy v1.3.0 // indirect
golang.org/x/sys v0.21.0 // indirect
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI=
github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8=
github.com/essentialkaos/ek/v12 v12.113.1 h1:3opV9dwRpIQq1fqg5mkaSEt6ogECL4VLzrH/829qeYg=
github.com/essentialkaos/ek/v12 v12.113.1/go.mod h1:SslW97Se34YQKc08Ume2V/8h/HPTgLS1+Iok64cNF/U=
github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU=
github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8=
github.com/essentialkaos/ek/v12 v12.127.0 h1:fU5A+QbIZ7NTq1K5jGVwAWwuLtBUhsIKuRWYT78hE+Q=
github.com/essentialkaos/ek/v12 v12.127.0/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw=
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=