diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fc51337..d0ad1de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,12 @@ updates: - "andyone" reviewers: - "andyone" + groups: + all: + applies-to: version-updates + update-types: + - "minor" + - "patch" - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/images/card.svg b/.github/images/card.svg new file mode 100644 index 0000000..cca9c22 --- /dev/null +++ b/.github/images/card.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.github/images/license.svg b/.github/images/license.svg new file mode 100644 index 0000000..8990e77 --- /dev/null +++ b/.github/images/license.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.github/images/usage.svg b/.github/images/usage.svg new file mode 100644 index 0000000..e91e279 --- /dev/null +++ b/.github/images/usage.svg @@ -0,0 +1,74 @@ + + diff --git a/Makefile b/Makefile index 87011c8..f80c085 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,40 @@ ################################################################################ -# This Makefile generated by GoMakeGen 2.3.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.18 +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: mdtoc ## Build all binaries mdtoc: - go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" mdtoc.go + @echo "[36;1mBuilding mdtoc…[0m" + @go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" mdtoc.go install: ## Install all binaries - cp mdtoc /usr/bin/mdtoc + @echo "[36;1mInstalling binaries…[0m" + @cp mdtoc /usr/bin/mdtoc uninstall: ## Uninstall all binaries - rm -f /usr/bin/mdtoc + @echo "[36;1mRemoving installed binaries…[0m" + @rm -f /usr/bin/mdtoc init: mod-init ## Initialize new module @@ -44,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions vendor: mod-vendor ## Make vendored copy of dependencies mod-init: + @echo "[37m[1/2][0m [36;1mModules initialization…[0m" 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 "[37m[2/2][0m [36;1mDependencies cleanup…[0m" ifdef COMPAT ## Compatible Go version (String) - go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(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 "[37m[1/4][0m [36;1mUpdating dependencies…[0m" 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 "[37m[2/4][0m [36;1mStripping toolchain info…[0m" + @grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || : + + @echo "[37m[3/4][0m [36;1mDependencies cleanup…[0m" 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 "[37m[4/4][0m [36;1mUpdating vendored dependencies…[0m" + @test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || : mod-download: - go mod download + @echo "[36;1mDownloading dependencies…[0m" + @go mod download mod-vendor: - rm -rf vendor && go mod vendor $(VERBOSE_FLAG) + @echo "[36;1mVendoring dependencies…[0m" + @rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || : fmt: ## Format source code with gofmt - find . -name "*.go" -exec gofmt -s -w {} \; + @echo "[36;1mFormatting sources…[0m" + @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 "[36;1mRunning 'go vet' over sources…[0m" + @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 mdtoc + @echo "[36;1mRemoving built binaries…[0m" + @rm -f mdtoc 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.3.0\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n' ################################################################################ diff --git a/README.md b/README.md index 753866c..7b664ad 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ -
+ -Installation • Usage • Build Status • Contributing • License
+Installation • Usage • CI Status • Contributing • License