Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
go-version: "1.24"
-
name: Download modules
run: |
Expand Down
42 changes: 23 additions & 19 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
run:
timeout: 10m
version: "2"

linters:
default: none
enable:
- depguard
- gofmt
- goimports
- revive
- govet
- importas
- ineffassign
- misspell
- typecheck
- errname
- makezero
- whitespace
disable-all: true

linters-settings:
depguard:
settings:
depguard:
rules:
main:
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
importas:
no-unaliased: true
exclusions:
generated: lax
rules:
main:
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
importas:
no-unaliased: true
- linters:
- revive
text: stutters

formatters:
enable:
- gofmt
- goimports

issues:
exclude-rules:
- linters:
- revive
text: "stutters"
max-issues-per-linter: 0
max-same-issues: 0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG GO_VERSION="1.23"
ARG GO_VERSION="1.24"
ARG XX_VERSION="1.6.1"
ARG GOLANGCI_LINT_VERSION="v1.62"
ARG GOLANGCI_LINT_VERSION="v2.1.5"
ARG ADDLICENSE_VERSION="v1.1.1"

ARG LICENSE_ARGS="-c cli-docs-tool -l apache"
Expand Down
1 change: 1 addition & 0 deletions annotation/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package annotation handles annotations for CLI commands.
package annotation

const (
Expand Down
1 change: 1 addition & 0 deletions clidocstool.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package clidocstool provides tools for generating CLI documentation.
package clidocstool

import (
Expand Down
4 changes: 2 additions & 2 deletions clidocstool_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ func genFlagResult(cmd *cobra.Command, flags *pflag.FlagSet, anchors map[string]
//
// This makes the generated YAML more readable, and easier to review changes.
// max can be used to customize the width to keep the whole line < 80 chars.
func forceMultiLine(s string, max int) string {
func forceMultiLine(s string, maxWidth int) string {
s = strings.TrimSpace(s)
if len(s) > max && !strings.Contains(s, "\n") {
if len(s) > maxWidth && !strings.Contains(s, "\n") {
s = s + "\n"
}
return s
Expand Down
2 changes: 1 addition & 1 deletion example/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/docker/cli-docs-tool/example

go 1.20
go 1.23.0

require (
github.com/docker/buildx v0.11.2
Expand Down
48 changes: 48 additions & 0 deletions example/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/docker/cli-docs-tool

go 1.18
go 1.23.0

require (
github.com/spf13/cobra v1.8.1
Expand Down