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.0.1 #125

Merged
merged 27 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
58ef535
Bump github.com/essentialkaos/ek/v12 from 12.113.1 to 12.114.0
dependabot[bot] Apr 4, 2024
f4353ec
Merge pull request #111 from essentialkaos/dependabot/go_modules/deve…
andyone Apr 4, 2024
82d754d
Bump github.com/essentialkaos/ek/v12 from 12.114.0 to 12.116.0
dependabot[bot] Apr 23, 2024
fa1d8c0
Merge pull request #113 from essentialkaos/dependabot/go_modules/deve…
andyone Apr 24, 2024
0932df8
Bump github.com/essentialkaos/ek/v12 from 12.116.0 to 12.121.0
dependabot[bot] May 3, 2024
a7638f8
Merge pull request #116 from essentialkaos/dependabot/go_modules/deve…
andyone May 3, 2024
d7d3208
Bump github.com/essentialkaos/ek/v12 from 12.121.0 to 12.122.0
dependabot[bot] May 6, 2024
ce0791c
Merge pull request #117 from essentialkaos/dependabot/go_modules/deve…
andyone May 6, 2024
e0c68d8
Bump github.com/essentialkaos/ek/v12 from 12.122.0 to 12.123.2
dependabot[bot] May 8, 2024
5f35b90
Merge pull request #119 from essentialkaos/dependabot/go_modules/deve…
andyone May 8, 2024
76d97ae
Bump github.com/essentialkaos/ek/v12 from 12.123.2 to 12.124.0
dependabot[bot] May 13, 2024
4d3e55a
Merge pull request #120 from essentialkaos/dependabot/go_modules/deve…
andyone May 13, 2024
1f28359
---
dependabot[bot] May 21, 2024
e2b533e
Merge pull request #121 from essentialkaos/dependabot/go_modules/deve…
andyone May 21, 2024
68e3a2b
Bump github.com/essentialkaos/ek/v12 from 12.125.0 to 12.125.1
dependabot[bot] Jun 4, 2024
bcdfa92
Merge pull request #122 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 4, 2024
4ee3d05
Improve README
andyone Jun 8, 2024
9c1ac53
Regenerate usage svg
andyone Jun 8, 2024
00d5bb4
Bump github.com/essentialkaos/ek/v12 from 12.125.1 to 12.126.0
dependabot[bot] Jun 11, 2024
2d3d040
Merge pull request #123 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 11, 2024
a71d1f5
Bump github.com/essentialkaos/ek/v12 from 12.126.0 to 12.126.1
dependabot[bot] Jun 13, 2024
a63f364
Merge pull request #124 from essentialkaos/dependabot/go_modules/deve…
andyone Jun 13, 2024
0a9f5d9
Improve dependabot configuration
andyone Jun 15, 2024
d1a02f8
Regenerate Makefile with the latest version of gomakegen
andyone Jun 15, 2024
c90ded9
Improve README
andyone Jun 15, 2024
b86ac22
Version bump
andyone Jun 22, 2024
5919e76
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
4 changes: 4 additions & 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.
1 change: 1 addition & 0 deletions .github/images/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 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: goheft ## Build all binaries

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

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

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

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 goheft
@echo "Removing built binaries…"
@rm -f goheft

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'

################################################################################
29 changes: 3 additions & 26 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/goheft.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/goheft/ci"><img src="https://kaos.sh/w/goheft/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/goheft"><img src="https://kaos.sh/r/goheft.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/b/goheft"><img src="https://kaos.sh/b/43c7247d-ff5d-4684-8d9d-cf5e85b8c7a7.svg" alt="codebeat badge" /></a>
<a href="https://kaos.sh/w/goheft/codeql"><img src="https://kaos.sh/w/goheft/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="#usage-demo">Usage demo</a> • <a href="#installation">Installation</a> • <a href="#usage">Usage</a> • <a href="#build-status">Build Status</a> • <a href="#contributing">Contributing</a> • <a href="#license">License</a></p>
Expand Down Expand Up @@ -67,30 +67,7 @@ goheft --generate-man | sudo gzip > /usr/share/man/man1/goheft.1.gz

### Usage

```
Usage: goheft {options} go-file

Options

--tags, -t tag… Build tags (mergeble)
--external, -E Shadow internal packages
--pager, -P Use pager for long output
--min-size, -m size Don't show with size less than defined
--no-color, -nc Disable colors in output
--help, -h Show this help message
--version, -v Show version

Examples

goheft application.go
Show size of each used library

goheft application.go -m 750kb
Show size of each used library which greater than 750kb

goheft application.go -t release,slim
Use tags when building and counting size
```
<p align="center"><img src=".github/images/usage.svg"/></p>

### Build Status

Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const (
APP = "GoHeft"
VER = "1.0.0"
VER = "1.0.1"
DESC = "Utility for listing sizes of used static libraries"
)

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module github.com/essentialkaos/goheft

go 1.18

require github.com/essentialkaos/ek/v12 v12.113.1
require github.com/essentialkaos/ek/v12 v12.127.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
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=