Skip to content

Commit

Permalink
Merge pull request #178 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 2.2.2
  • Loading branch information
andyone authored Oct 30, 2024
2 parents e48de3c + 97f83cc commit c7fcbc6
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 66 deletions.
9 changes: 0 additions & 9 deletions .codebeatsettings

This file was deleted.

6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updates:
target-branch: "develop"
schedule:
interval: "daily"
timezone: "Europe/London"
timezone: "Etc/UTC"
time: "03:00"
labels:
- "PR • MAINTENANCE"
Expand All @@ -26,8 +26,8 @@ updates:
target-branch: "develop"
schedule:
interval: "daily"
timezone: "Europe/London"
time: "04:00"
timezone: "Etc/UTC"
time: "03:00"
labels:
- "PR • MAINTENANCE"
assignees:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
go: [ '1.19.x', '1.20.x', '1.21.x', '1.22.x' ]
go: [ '1.22.x', '1.23.x' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Download dependencies
run: make deps
Expand Down
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################

# This Makefile generated by GoMakeGen 3.0.1 using next command:
# This Makefile generated by GoMakeGen 3.2.0 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen
Expand All @@ -11,6 +11,16 @@ ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

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

COMPAT ?= 1.19
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)
Expand Down Expand Up @@ -107,8 +117,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%-11s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 3.0.1\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 3.2.0\033[0m\n'

################################################################################
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<p align="center"><a href="#readme"><img src=".github/images/card.svg"/></a></p>

<p align="center">
<a href="https://kaos.sh/w/aligo/ci"><img src="https://kaos.sh/w/aligo/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/aligo"><img src="https://kaos.sh/r/aligo.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/b/aligo"><img src="https://codebeat.co/badges/18a359f5-50dd-4bfc-95b2-07dee23d018a" alt="codebeat badge" /></a>
<a href="https://kaos.sh/y/aligo"><img src="https://kaos.sh/y/be732041f34d4e92a12a28a386b3558a.svg" alt="Codacy badge" /></a>
<a href="https://kaos.sh/w/aligo/ci"><img src="https://kaos.sh/w/aligo/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/w/aligo/codeql"><img src="https://kaos.sh/w/aligo/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="#license"><img src=".github/images/license.svg"/></a>
</p>

<p align="center"><a href="#screenshots">Screenshots</a> • <a href="#installation">Installation</a> • <a href="#command-line-completion">Command-line completion</a> • <a href="#man-documentation">Man documentation</a> • <a href="#faq">FAQ</a> • <a href="#usage">Usage</a><a href="#ci-status">CI Status</a> • <a href="#contributing">Contributing</a> • <a href="#thanks">Thanks</a> • <a href="#license">License</a></p>
<p align="center"><a href="#screenshots">Screenshots</a> • <a href="#installation">Installation</a> • <a href="#command-line-completion">Command-line completion</a> • <a href="#man-documentation">Man documentation</a> • <a href="#faq">FAQ</a> • <a href="#usage">Usage</a><br/><a href="#ci-status">CI Status</a> • <a href="#contributing">Contributing</a> • <a href="#thanks">Thanks</a> • <a href="#license">License</a></p>

<br/>

Expand All @@ -25,7 +25,7 @@

#### From source

To build the _aligo_ from scratch, make sure you have a working Go 1.19+ workspace (_[instructions](https://go.dev/doc/install)_), then:
To build the _aligo_ 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/aligo/v2@latest
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20.x'
go-version: '1.22.x'

- name: Check Golang sources with Aligo
uses: essentialkaos/aligo-action@v2
Expand Down
36 changes: 18 additions & 18 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ import (
"runtime"
"strings"

"github.com/essentialkaos/ek/v12/fmtc"
"github.com/essentialkaos/ek/v12/fmtutil"
"github.com/essentialkaos/ek/v12/options"
"github.com/essentialkaos/ek/v12/pager"
"github.com/essentialkaos/ek/v12/strutil"
"github.com/essentialkaos/ek/v12/support"
"github.com/essentialkaos/ek/v12/support/apps"
"github.com/essentialkaos/ek/v12/support/deps"
"github.com/essentialkaos/ek/v12/terminal"
"github.com/essentialkaos/ek/v12/terminal/tty"
"github.com/essentialkaos/ek/v12/usage"
"github.com/essentialkaos/ek/v12/usage/completion/bash"
"github.com/essentialkaos/ek/v12/usage/completion/fish"
"github.com/essentialkaos/ek/v12/usage/completion/zsh"
"github.com/essentialkaos/ek/v12/usage/man"
"github.com/essentialkaos/ek/v12/usage/update"
"github.com/essentialkaos/ek/v13/fmtc"
"github.com/essentialkaos/ek/v13/fmtutil"
"github.com/essentialkaos/ek/v13/options"
"github.com/essentialkaos/ek/v13/pager"
"github.com/essentialkaos/ek/v13/strutil"
"github.com/essentialkaos/ek/v13/support"
"github.com/essentialkaos/ek/v13/support/apps"
"github.com/essentialkaos/ek/v13/support/deps"
"github.com/essentialkaos/ek/v13/terminal"
"github.com/essentialkaos/ek/v13/terminal/tty"
"github.com/essentialkaos/ek/v13/usage"
"github.com/essentialkaos/ek/v13/usage/completion/bash"
"github.com/essentialkaos/ek/v13/usage/completion/fish"
"github.com/essentialkaos/ek/v13/usage/completion/zsh"
"github.com/essentialkaos/ek/v13/usage/man"
"github.com/essentialkaos/ek/v13/usage/update"

"github.com/essentialkaos/aligo/v2/cli/i18n"
"github.com/essentialkaos/aligo/v2/inspect"
Expand All @@ -41,7 +41,7 @@ import (
// App info
const (
APP = "aligo"
VER = "2.2.1"
VER = "2.2.2"
)

// Constants with options names
Expand Down Expand Up @@ -90,7 +90,7 @@ func Run(gitRev string, gomod []byte) {

if !errs.IsEmpty() {
terminal.Error(i18n.UI.ERRORS.OPTION_PARSING.Add("", ":"))
terminal.Error(errs.String())
terminal.Error(errs.Error("- "))
os.Exit(1)
}

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

"github.com/essentialkaos/ek/v12/i18n"
"github.com/essentialkaos/ek/v13/i18n"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
14 changes: 10 additions & 4 deletions cli/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"fmt"
"strings"

"github.com/essentialkaos/ek/v12/fmtc"
"github.com/essentialkaos/ek/v12/fmtutil"
"github.com/essentialkaos/ek/v12/mathutil"
"github.com/essentialkaos/ek/v12/terminal"
"github.com/essentialkaos/ek/v13/fmtc"
"github.com/essentialkaos/ek/v13/fmtutil"
"github.com/essentialkaos/ek/v13/mathutil"
"github.com/essentialkaos/ek/v13/terminal"

"github.com/essentialkaos/aligo/v2/cli/i18n"
"github.com/essentialkaos/aligo/v2/inspect"
Expand Down Expand Up @@ -283,6 +283,12 @@ func printCurrentFieldsInfo(fields []*report.Field) {

fmt.Print(strings.Repeat(" ", int(counter+1)))

// Ensure we don't panic when hitting an empty struct{}.
if field.Size == 0 {
fmtc.NewLine()
continue
}

for counter%field.Size != 0 {
fmtc.Printf("{r}□{!} ")
counter++
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module github.com/essentialkaos/aligo/v2

go 1.18
go 1.22.8

require (
github.com/essentialkaos/ek/v12 v12.126.1
github.com/essentialkaos/ek/v13 v13.9.2
github.com/kisielk/gotool v1.0.0
golang.org/x/tools v0.22.0
golang.org/x/tools v0.26.0
)

require (
github.com/essentialkaos/depsy v1.3.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
github.com/essentialkaos/depsy v1.3.1 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
)
32 changes: 18 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
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.126.1 h1:K4tCpu9T3k5Bv6hJ1lmW7Ou0GxjgjBIKRsoZgAGdEhE=
github.com/essentialkaos/ek/v12 v12.126.1/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw=
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.9.2 h1:3sXGDUZ5C5+8tSmat1cTj6lhYIzCOlcaHC2ulShF2OQ=
github.com/essentialkaos/ek/v13 v13.9.2/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
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=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
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/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
3 changes: 2 additions & 1 deletion inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ func getStructReport(info *structInfo) *report.Struct {
Ignore: info.Skip,
}

numFields := info.Type.NumFields()
// Use AST fields list length, otherwise List[i] below can panic.
numFields := len(info.AST.Fields.List)

for i := 0; i < numFields; i++ {
f := info.Type.Field(i)
Expand Down

0 comments on commit c7fcbc6

Please sign in to comment.