diff --git a/.codebeatsettings b/.codebeatsettings deleted file mode 100644 index bba83e76..00000000 --- a/.codebeatsettings +++ /dev/null @@ -1,10 +0,0 @@ -{ - "GOLANG": { - "ABC": [25, 50, 70, 100], - "CYCLO": [20, 35, 75, 100], - "LOC": [70, 150, 250, 500], - "TOO_MANY_IVARS": [12, 16, 20, 24], - "TOO_MANY_FUNCTIONS": [50, 70, 90, 120], - "TOTAL_LOC": [500, 750, 1000, 2000] - } -} diff --git a/.docker/ol8.docker b/.docker/ol8.docker index 4e460d43..20ae1c66 100644 --- a/.docker/ol8.docker +++ b/.docker/ol8.docker @@ -1,10 +1,10 @@ ## REGISTRY CONFIGURATION ###################################################### -ARG REGISTRY="docker.io" +ARG REGISTRY="ghcr.io" ## BUILDER ##################################################################### -FROM ${REGISTRY}/essentialkaos/golang:ol8 as builder +FROM ${REGISTRY}/essentialkaos/golang:ol8 AS builder RUN mkdir -p "/go/src" && chmod -R 777 "/go" diff --git a/.docker/ol9.docker b/.docker/ol9.docker index 5efa9450..467c12be 100644 --- a/.docker/ol9.docker +++ b/.docker/ol9.docker @@ -1,10 +1,10 @@ ## REGISTRY CONFIGURATION ###################################################### -ARG REGISTRY="docker.io" +ARG REGISTRY="ghcr.io" ## BUILDER ##################################################################### -FROM ${REGISTRY}/essentialkaos/golang:ol9 as builder +FROM ${REGISTRY}/essentialkaos/golang:ol9 AS builder RUN mkdir -p "/go/src" && chmod -R 777 "/go" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 11416091..605744aa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,7 @@ updates: schedule: interval: "daily" timezone: "Etc/UTC" - time: "07:00" + time: "03:00" labels: - "PR • MAINTENANCE" assignees: @@ -27,7 +27,7 @@ updates: schedule: interval: "daily" timezone: "Etc/UTC" - time: "08:00" + time: "03:00" labels: - "PR • MAINTENANCE" assignees: diff --git a/Makefile b/Makefile index 278e2bc8..448077c8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ -# This Makefile generated by GoMakeGen 3.0.2 using next command: +# This Makefile generated by GoMakeGen 3.2.1 using next command: # gomakegen --mod . # # More info: https://kaos.sh/gomakegen @@ -11,7 +11,16 @@ ifdef VERBOSE ## Print verbose information (Flag) VERBOSE_FLAG = -v endif -COMPAT ?= 1.19 +ifdef PROXY ## Force proxy usage for downloading dependencies (Flag) +export GOPROXY=https://proxy.golang.org/cached-only,direct +endif + +ifdef CGO ## Enable CGO usage (Flag) +export CGO_ENABLED=1 +else +export CGO_ENABLED=0 +endif + MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD) @@ -53,7 +62,7 @@ else endif gen-fuzz: ## Generate archives for fuzz testing - @which go-fuzz-build &>/dev/null || go get -u -v github.com/dvyukov/go-fuzz/go-fuzz-build + @which go-fuzz-build &>/dev/null || go install github.com/dvyukov/go-fuzz/go-fuzz-build@latest @echo "Generating fuzzing data…" @go-fuzz-build -o parser-fuzz.zip github.com/essentialkaos/bibop/parser @@ -120,8 +129,9 @@ help: ## Show this info @echo -e '\n\033[1mVariables:\033[0m\n' @grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \ | sed 's/ifdef //' \ + | sort -h \ | awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-13s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 3.2.1\033[0m\n' ################################################################################ diff --git a/README.md b/README.md index 141bf3f3..98030007 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@

GoReportCard Code Climate Maintainability - codebeat badge Codacy badge
GitHub Actions CI Status @@ -28,7 +27,7 @@ https://github.com/essentialkaos/bibop/assets/182020/c63dc147-fa44-40df-92e2-12f #### From source -To build the `bibop` from scratch, make sure you have a working Go 1.22+ workspace ([instructions](https://go.dev/doc/install)), then: +To build the `bibop` from scratch, make sure you have a working Go [1.22+](https://github.com/essentialkaos/.github/blob/master/GO-VERSION-SUPPORT.md) workspace ([instructions](https://go.dev/doc/install)), then: ``` go install github.com/essentialkaos/bibop@latest diff --git a/cli/cli.go b/cli/cli.go index 0940bf20..3d0af575 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -24,6 +24,7 @@ import ( "github.com/essentialkaos/ek/v13/support" "github.com/essentialkaos/ek/v13/support/deps" "github.com/essentialkaos/ek/v13/support/pkgs" + "github.com/essentialkaos/ek/v13/support/resources" "github.com/essentialkaos/ek/v13/terminal" "github.com/essentialkaos/ek/v13/terminal/tty" "github.com/essentialkaos/ek/v13/usage" @@ -44,7 +45,7 @@ import ( // Application info const ( APP = "bibop" - VER = "8.1.1" + VER = "8.1.2" DESC = "Utility for testing command-line tools" ) @@ -117,7 +118,7 @@ func Run(gitRev string, gomod []byte) { if !errs.IsEmpty() { terminal.Error("Options parsing errors:") - terminal.Error(errs.String()) + terminal.Error(errs.Error("- ")) os.Exit(1) } @@ -141,6 +142,7 @@ func Run(gitRev string, gomod []byte) { "initscripts", "libc-bin", "dpkg", "gcc", "python2", "python3", "binutils", )). + WithResources(resources.Collect()). Print() os.Exit(0) case options.GetB(OPT_HELP) || len(args) == 0: diff --git a/cli/executor/executor.go b/cli/executor/executor.go index 7ed542c5..8251dc28 100644 --- a/cli/executor/executor.go +++ b/cli/executor/executor.go @@ -16,7 +16,7 @@ import ( "syscall" "time" - "github.com/essentialkaos/ek/v13/errutil" + "github.com/essentialkaos/ek/v13/errors" "github.com/essentialkaos/ek/v13/fmtc" "github.com/essentialkaos/ek/v13/fmtutil/panel" "github.com/essentialkaos/ek/v13/fsutil" @@ -162,7 +162,7 @@ func NewExecutor(cfg *Config) *Executor { // Validate validates recipe func (e *Executor) Validate(r *recipe.Recipe, cfg *ValidationConfig) []error { - errs := errutil.NewErrors() + errs := errors.NewBundle() errs.Add(checkRecipeWorkingDir(r)) errs.Add(checkRecipeTags(r, cfg.Tags)) @@ -180,7 +180,7 @@ func (e *Executor) Validate(r *recipe.Recipe, cfg *ValidationConfig) []error { errs.Add(checkDependencies(r)) } - if !errs.HasErrors() { + if errs.IsEmpty() { return nil } diff --git a/go.mod b/go.mod index 57c50253..f2db639b 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,18 @@ module github.com/essentialkaos/bibop -go 1.21 +go 1.22.8 require ( github.com/buger/jsonparser v1.1.1 - github.com/creack/pty v1.1.23 - github.com/essentialkaos/check v1.4.0 - github.com/essentialkaos/ek/v13 v13.3.5 + github.com/creack/pty v1.1.24 + github.com/essentialkaos/check v1.4.1 + github.com/essentialkaos/ek/v13 v13.12.0 ) require ( - github.com/essentialkaos/depsy v1.3.0 // indirect + github.com/essentialkaos/depsy v1.3.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - golang.org/x/sys v0.24.0 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + golang.org/x/sys v0.27.0 // indirect ) diff --git a/go.sum b/go.sum index e0805062..4ad4e673 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,21 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.23 h1:4M6+isWdcStXEf15G/RbrMPOQj1dZ7HPZCGwE4kOeP0= -github.com/creack/pty v1.1.23/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= -github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= -github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0= -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/v13 v13.3.5 h1:k/lfDIpgE+8dOc+eF37m1hOi8eEMHYYTEzD5KHH3xxU= -github.com/essentialkaos/ek/v13 v13.3.5/go.mod h1:FWHXQ74YiSCsi/H9kmHR68fUE8aYUNcp0Fzz98XGUtM= +github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= +github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= +github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1s4c8= +github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= +github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= +github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= +github.com/essentialkaos/ek/v13 v13.12.0 h1:NV5pZWzD2vIMBDoTihAwFRoLuN2xV6ie47unhS/H8nc= +github.com/essentialkaos/ek/v13 v13.12.0/go.mod h1:GAoS44v5gtd3Yc1qqfgXsaJNoC0dMw1ueW5Fc9TTHUg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=