diff --git a/go.mod b/go.mod index cb0882aa..f04719bc 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/PuerkitoBio/purell v1.2.2 github.com/briandowns/spinner v1.23.2 github.com/charmbracelet/glamour v1.0.0 - github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 + github.com/charmbracelet/lipgloss v1.1.1 github.com/cli/safeexec v1.0.1 github.com/cpuguy83/go-md2man/v2 v2.0.7 github.com/emirpasic/gods v1.18.1 diff --git a/go.sum b/go.sum index a934701c..a8a6f453 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/charmbracelet/glamour v1.0.0 h1:AWMLOVFHTsysl4WV8T8QgkQ0s/ZNZo7CiE4WK github.com/charmbracelet/glamour v1.0.0/go.mod h1:DSdohgOBkMr2ZQNhw4LZxSGpx3SvpeujNoXrQyH2hxo= github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 h1:ZR7e0ro+SZZiIZD7msJyA+NjkCNNavuiPBLgerbOziE= github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834/go.mod h1:aKC/t2arECF6rNOnaKaVU6y4t4ZeHQzqfxedE/VkVhA= +github.com/charmbracelet/lipgloss v1.1.1 h1:VIoGs3r434Pg4i5ce7w4HwUponuyIPuTNwQz9J5tC+A= +github.com/charmbracelet/lipgloss v1.1.1/go.mod h1:0nOWKgJ7Z/lEEavTZvkdAYjDpKTlbkqRv8zerAqtye8= github.com/charmbracelet/x/ansi v0.10.2 h1:ith2ArZS0CJG30cIUfID1LXN7ZFXRCww6RUvAPA+Pzw= github.com/charmbracelet/x/ansi v0.10.2/go.mod h1:HbLdJjQH4UH4AqA2HpRWuWNluRE6zxJH/yteYEYCFa8= github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= diff --git a/vendor/github.com/charmbracelet/lipgloss/.editorconfig b/vendor/github.com/charmbracelet/lipgloss/.editorconfig deleted file mode 100644 index 5de2df8c..00000000 --- a/vendor/github.com/charmbracelet/lipgloss/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# https://editorconfig.org/ - -root = true - -[*] -charset = utf-8 -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 2 - -[*.go] -indent_style = tab -indent_size = 8 - -[*.golden] -insert_final_newline = false -trim_trailing_whitespace = false diff --git a/vendor/github.com/charmbracelet/lipgloss/.gitattributes b/vendor/github.com/charmbracelet/lipgloss/.gitattributes deleted file mode 100644 index d5273520..00000000 --- a/vendor/github.com/charmbracelet/lipgloss/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.golden linguist-generated=true -text diff --git a/vendor/github.com/charmbracelet/lipgloss/.golangci.yml b/vendor/github.com/charmbracelet/lipgloss/.golangci.yml index 7c0a115e..90c5c08b 100644 --- a/vendor/github.com/charmbracelet/lipgloss/.golangci.yml +++ b/vendor/github.com/charmbracelet/lipgloss/.golangci.yml @@ -1,6 +1,17 @@ -version: "2" run: tests: false + +issues: + include: + - EXC0001 + - EXC0005 + - EXC0011 + - EXC0012 + - EXC0013 + + max-issues-per-linter: 0 + max-same-issues: 0 + linters: enable: - bodyclose @@ -8,6 +19,8 @@ linters: - goconst - godot - godox + - gofumpt + - goimports - gomoddirectives - goprintffuncname - gosec @@ -26,24 +39,3 @@ linters: - unparam - whitespace - wrapcheck - exclusions: - generated: lax - presets: - - common-false-positives - paths: - - third_party$ - - builtin$ - - examples$ -issues: - max-issues-per-linter: 0 - max-same-issues: 0 -formatters: - enable: - - gofumpt - - goimports - exclusions: - generated: lax - paths: - - third_party$ - - builtin$ - - examples$ diff --git a/vendor/github.com/charmbracelet/lipgloss/README.md b/vendor/github.com/charmbracelet/lipgloss/README.md index cee2371c..1f2fd7c4 100644 --- a/vendor/github.com/charmbracelet/lipgloss/README.md +++ b/vendor/github.com/charmbracelet/lipgloss/README.md @@ -1,5 +1,14 @@ # Lip Gloss +> [!WARNING] +> +> This module path is deprecated and will not receive further updates. Use +> [`charm.land/lipgloss/v2`](https://pkg.go.dev/charm.land/lipgloss/v2) instead: +> +> ```bash +> go get charm.land/lipgloss/v2@latest +> ``` +

Lip Gloss title treatment
Latest Release diff --git a/vendor/github.com/charmbracelet/lipgloss/get.go b/vendor/github.com/charmbracelet/lipgloss/get.go index 146462f2..422b4ce9 100644 --- a/vendor/github.com/charmbracelet/lipgloss/get.go +++ b/vendor/github.com/charmbracelet/lipgloss/get.go @@ -530,7 +530,7 @@ func (s Style) implicitBorders() bool { bottomSet = s.isSet(borderBottomKey) leftSet = s.isSet(borderLeftKey) ) - return borderStyle != noBorder && !(topSet || rightSet || bottomSet || leftSet) //nolint:staticcheck + return borderStyle != noBorder && !(topSet || rightSet || bottomSet || leftSet) } func (s Style) getAsTransform(propKey) func(string) string { diff --git a/vendor/github.com/charmbracelet/lipgloss/join.go b/vendor/github.com/charmbracelet/lipgloss/join.go index 3e6688e2..b0a23a54 100644 --- a/vendor/github.com/charmbracelet/lipgloss/join.go +++ b/vendor/github.com/charmbracelet/lipgloss/join.go @@ -165,7 +165,7 @@ func JoinVertical(pos Position, strs ...string) string { // Write a newline as long as we're not on the last line of the // last block. - if !(i == len(blocks)-1 && j == len(block)-1) { //nolint:staticcheck + if !(i == len(blocks)-1 && j == len(block)-1) { b.WriteRune('\n') } } diff --git a/vendor/github.com/charmbracelet/lipgloss/lipgloss.go b/vendor/github.com/charmbracelet/lipgloss/lipgloss.go deleted file mode 100644 index 3fb4e6f2..00000000 --- a/vendor/github.com/charmbracelet/lipgloss/lipgloss.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package lipgloss provides style definitions for nice terminal layouts. Built -// with TUIs in mind. -package lipgloss diff --git a/vendor/github.com/charmbracelet/lipgloss/table/resizing.go b/vendor/github.com/charmbracelet/lipgloss/table/resizing.go index 30b0a010..2bbacfc7 100644 --- a/vendor/github.com/charmbracelet/lipgloss/table/resizing.go +++ b/vendor/github.com/charmbracelet/lipgloss/table/resizing.go @@ -59,11 +59,6 @@ func (t *Table) resize() { allRows = rows } - styleFunc := t.styleFunc - if t.styleFunc == nil { - styleFunc = DefaultStyles - } - r.rowHeights = r.defaultRowHeights() for i, row := range allRows { @@ -78,7 +73,7 @@ func (t *Table) resize() { if hasHeaders { rowIndex-- } - style := styleFunc(rowIndex, j) + style := t.styleFunc(rowIndex, j) topMargin, rightMargin, bottomMargin, leftMargin := style.GetMargin() topPadding, rightPadding, bottomPadding, leftPadding := style.GetPadding() @@ -212,7 +207,7 @@ func (r *resizer) expandTableWidth() (colWidths, rowHeights []int) { colWidths[shorterColumnIndex]++ } - rowHeights = r.expandRowHeights(colWidths) + rowHeights = r.expandRowHeigths(colWidths) return } @@ -288,23 +283,17 @@ func (r *resizer) shrinkTableWidth() (colWidths, rowHeights []int) { shrinkToMedian() shrinkBiggestColumns(false) - return colWidths, r.expandRowHeights(colWidths) + return colWidths, r.expandRowHeigths(colWidths) } -// expandRowHeights expands the row heights. -func (r *resizer) expandRowHeights(colWidths []int) (rowHeights []int) { +// expandRowHeigths expands the row heights. +func (r *resizer) expandRowHeigths(colWidths []int) (rowHeights []int) { rowHeights = r.defaultRowHeights() if !r.wrap { return rowHeights } - hasHeaders := len(r.headers) > 0 - for i, row := range r.allRows { for j, cell := range row { - // NOTE(@andreynering): Headers always have a height of 1, even when wrap is enabled. - if hasHeaders && i == 0 { - continue - } height := r.detectContentHeight(cell, colWidths[j]-r.xPaddingForCol(j)) + r.xPaddingForCell(i, j) if height > rowHeights[i] { rowHeights[i] = height diff --git a/vendor/github.com/charmbracelet/lipgloss/table/table.go b/vendor/github.com/charmbracelet/lipgloss/table/table.go index ad17fcfb..1aae4aeb 100644 --- a/vendor/github.com/charmbracelet/lipgloss/table/table.go +++ b/vendor/github.com/charmbracelet/lipgloss/table/table.go @@ -1,4 +1,3 @@ -// Package table provides a styled table renderer for terminals. package table import ( @@ -347,25 +346,16 @@ func (t *Table) constructBottomBorder() string { // constructHeaders constructs the headers for the table given it's current // header configuration and data. func (t *Table) constructHeaders() string { - height := t.heights[HeaderRow+1] - var s strings.Builder if t.borderLeft { s.WriteString(t.borderStyle.Render(t.border.Left)) } for i, header := range t.headers { - cellStyle := t.style(HeaderRow, i) - - if !t.wrap { - header = t.truncateCell(header, HeaderRow, i) - } - - s.WriteString(cellStyle. - Height(height - cellStyle.GetVerticalMargins()). - MaxHeight(height). - Width(t.widths[i] - cellStyle.GetHorizontalMargins()). + s.WriteString(t.style(HeaderRow, i). + MaxHeight(1). + Width(t.widths[i]). MaxWidth(t.widths[i]). - Render(t.truncateCell(header, HeaderRow, i))) + Render(ansi.Truncate(header, t.widths[i], "…"))) if i < len(t.headers)-1 && t.borderColumn { s.WriteString(t.borderStyle.Render(t.border.Left)) } @@ -445,6 +435,8 @@ func (t *Table) constructRow(index int, isOverflow bool) string { } for c := 0; c < t.data.Columns(); c++ { + cellWidth := t.widths[c] + cell := "…" if !isOverflow { cell = t.data.At(index, c) @@ -452,7 +444,8 @@ func (t *Table) constructRow(index int, isOverflow bool) string { cellStyle := t.style(index, c) if !t.wrap { - cell = t.truncateCell(cell, index, c) + length := (cellWidth * height) - cellStyle.GetHorizontalPadding() + cell = ansi.Truncate(cell, length, "…") } cells = append(cells, cellStyle. // Account for the margins in the cell sizing. @@ -478,7 +471,7 @@ func (t *Table) constructRow(index int, isOverflow bool) string { s.WriteString(lipgloss.JoinHorizontal(lipgloss.Top, cells...) + "\n") - if t.borderRow && index < t.data.Rows()-1 && !isOverflow { + if t.borderRow && index < t.data.Rows()-1 { s.WriteString(t.borderStyle.Render(t.border.MiddleLeft)) for i := 0; i < len(t.widths); i++ { s.WriteString(t.borderStyle.Render(strings.Repeat(t.border.Bottom, t.widths[i]))) @@ -491,13 +484,3 @@ func (t *Table) constructRow(index int, isOverflow bool) string { return s.String() } - -func (t *Table) truncateCell(cell string, rowIndex, colIndex int) string { - hasHeaders := len(t.headers) > 0 - height := t.heights[rowIndex+btoi(hasHeaders)] - cellWidth := t.widths[colIndex] - cellStyle := t.style(rowIndex, colIndex) - - length := (cellWidth * height) - cellStyle.GetHorizontalPadding() - cellStyle.GetHorizontalMargins() - return ansi.Truncate(cell, length, "…") -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c81c8d7b..69a80246 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -51,7 +51,7 @@ github.com/charmbracelet/glamour github.com/charmbracelet/glamour/ansi github.com/charmbracelet/glamour/internal/autolink github.com/charmbracelet/glamour/styles -# github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 +# github.com/charmbracelet/lipgloss v1.1.1 ## explicit; go 1.18 github.com/charmbracelet/lipgloss github.com/charmbracelet/lipgloss/table