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/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
user_email: 41898282+github-actions[bot]@users.noreply.github.com
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v6
with:
go-version: 1.24.x
go-version: 1.26.x
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
- name: Run GoReleaser (dry run)
env:
PACKAGE_NAME: github.com/lets-cli/lets
GOLANG_CROSS_VERSION: v1.24
GOLANG_CROSS_VERSION: v1.26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 goreleaser-cross tag lacks patch version

GOLANG_CROSS_VERSION is set to v1.26 (no patch component). The ghcr.io/goreleaser/goreleaser-cross images are typically published with full patch version tags (e.g., v1.26.0, v1.26.1). If the registry does not provide a floating v1.26 tag, both the dry-run and release steps will fail with an image-not-found error at runtime.

The same pattern existed previously (v1.24), so this may have been fine in practice — but it's worth pinning to a specific patch tag to make the workflow reproducible and avoid surprises when a new patch is published.

Suggested change
GOLANG_CROSS_VERSION: v1.26
GOLANG_CROSS_VERSION: v1.26.0

The same change should also be applied on line 36.

run: |
docker run \
--rm \
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Run GoReleaser
env:
PACKAGE_NAME: github.com/lets-cli/lets
GOLANG_CROSS_VERSION: v1.24
GOLANG_CROSS_VERSION: v1.26
run: |
docker run \
--rm \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
if: runner.os == 'macOS'
run: brew install bash
- name: Setup go
uses: actions/setup-go@v2
uses: actions/setup-go@v6
with:
go-version: 1.24.x
go-version: 1.26.x
- name: Checkout code
uses: actions/checkout@v2
- run: go install gotest.tools/gotestsum@latest
Expand Down
100 changes: 53 additions & 47 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,64 @@
version: "2"
run:
go: "1.26"
tests: false
go: "1.23"

linters:
enable-all: true
default: all

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The default: all setting under linters may not be a recognized key in the v2 golangci-lint config schema.

In v2 configs, the supported way to control linters is via enable, disable, and presets; default: all isn’t part of the documented schema and may be ignored or fail validation. Please verify against the v2 reference and switch to the supported fields so the intended linters are reliably applied.

disable:
- typecheck
- gomoddirectives
- containedctx
- gochecknoglobals
- goimports
- funlen
- godox
- maligned
- goerr113
- exhaustivestruct
- wrapcheck
- prealloc # enable it sometimes
- wsl
- ifshort
- unparam
- copyloopvar
- cyclop
- gocyclo
- depguard
- err113
- exhaustive
- exhaustruct
- forcetypeassert
- funlen
- funcorder
- gochecknoglobals
- gocognit
- tagliatelle
- nestif
- nlreturn
- gocritic
- gocyclo
- godoclint
- godox
- gomoddirectives
- goprintffuncname
- exhaustruct
- wastedassign
- gosec
- importas
- lll
- mnd
- musttag
- nestif
- nilnil
- noctx
- noinlineerr
- nlreturn
- prealloc
- recvcheck
- musttag
- mnd
- lll
- gocritic
- forcetypeassert
- exhaustive
- depguard
- revive
- gosec
- copyloopvar

linters-settings:
lll:
line-length: 120
varnamelen:
min-name-length: 1

issues:
exclude-rules:
- path: _test\.go
linters:
- gomnd
- path: set\.go
linters:
- typecheck
- tagliatelle
- unparam
- wastedassign
- wrapcheck
- whitespace
- wsl
Comment on lines 7 to +44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 goimports no longer explicitly disabled

The previous config explicitly disabled goimports. The new config migrates to default: all (golangci-lint v2) but goimports is absent from the disable list. If goimports is included in the v2 default set, any file whose imports are not in goimports order will now produce lint failures and could break the lint CI job.

It's worth verifying whether the legacy exclusion preset covers this, or whether goimports should be added back to the disable list to preserve prior behaviour:

Suggested change
disable:
- typecheck
- gomoddirectives
- containedctx
- gochecknoglobals
- goimports
- funlen
- godox
- maligned
- goerr113
- exhaustivestruct
- wrapcheck
- prealloc # enable it sometimes
- wsl
- ifshort
- unparam
- copyloopvar
- cyclop
- gocyclo
- depguard
- err113
- exhaustive
- exhaustruct
- forcetypeassert
- funlen
- funcorder
- gochecknoglobals
- gocognit
- tagliatelle
- nestif
- nlreturn
- gocritic
- gocyclo
- godoclint
- godox
- gomoddirectives
- goprintffuncname
- exhaustruct
- wastedassign
- gosec
- importas
- lll
- mnd
- musttag
- nestif
- nilnil
- noctx
- noinlineerr
- nlreturn
- prealloc
- recvcheck
- musttag
- mnd
- lll
- gocritic
- forcetypeassert
- exhaustive
- depguard
- revive
- gosec
- copyloopvar
linters-settings:
lll:
line-length: 120
varnamelen:
min-name-length: 1
issues:
exclude-rules:
- path: _test\.go
linters:
- gomnd
- path: set\.go
linters:
- typecheck
- tagliatelle
- unparam
- wastedassign
- wrapcheck
- wsl
disable:
- containedctx
- copyloopvar
- cyclop
- depguard
- err113
- exhaustive
- exhaustruct
- forcetypeassert
- funlen
- funcorder
- gochecknoglobals
- gocognit
- gocritic
- gocyclo
- godoclint
- godox
- goimports
- gomoddirectives
- goprintffuncname
- gosec
- importas
- lll
- mnd
- musttag
- nestif
- nilnil
- noctx
- noinlineerr
- nlreturn
- prealloc
- recvcheck
- revive
- tagliatelle
- unparam
- wastedassign
- wrapcheck
- wsl

settings:
lll:
line-length: 120
varnamelen:
min-name-length: 1
exclusions:
Comment thread
kindermax marked this conversation as resolved.
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- mnd
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24-bookworm AS builder
FROM golang:1.26-bookworm AS builder

ENV GOPROXY=https://proxy.golang.org
ENV CGO_ENABLED=1
Expand Down Expand Up @@ -26,6 +26,6 @@ COPY go.sum .

RUN go mod download

FROM golangci/golangci-lint:v1.64.7-alpine AS linter
FROM golangci/golangci-lint:v2.11.3-alpine AS linter

RUN mkdir -p /.cache && chmod -R 777 /.cache
6 changes: 6 additions & 0 deletions cmd/lets/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func main() {
log.Errorf("lets: print version error: %s", err)
os.Exit(1)
}

os.Exit(0)
}

Expand Down Expand Up @@ -116,6 +117,7 @@ func main() {
log.Errorf("lets: print help error: %s", err)
os.Exit(1)
}

os.Exit(0)
}

Expand Down Expand Up @@ -198,7 +200,9 @@ func parseRootFlags(args []string) (*flags, error) {
if visited.Contains(name) {
return true
}

visited.Add(name)

return false
}

Expand All @@ -218,10 +222,12 @@ func parseRootFlags(args []string) (*flags, error) {
if value == "" {
return nil, errors.New("--config must be set to value")
}

f.config = value
} else if len(args[idx:]) > 0 {
f.config = args[idx+1]
idx += 2

continue
}
}
Expand Down
1 change: 1 addition & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: Changelog

## [Unreleased](https://github.com/lets-cli/lets/releases/tag/v0.0.X)

* `[Dependency]` update go to `1.26`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Capitalize "Go" as the language name.

In this changelog entry, update go to Go: `*

  • [Dependency] update Go to `1.26``.
Suggested change
* `[Dependency]` update go to `1.26`
* `[Dependency]` update Go to `1.26`

* `[Added]` Show similar command suggestions on typos.
* `[Changed]` Exit code 2 on unknown command.
* `[Added]` Expose `LETS_OS` and `LETS_ARCH` environment variables at command runtime.
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/lets-cli/lets

go 1.24
go 1.26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Consider adding a toolchain directive

Since Go 1.21, the recommended practice is to pair the go directive with an explicit toolchain directive that pins the exact toolchain version. Without it, developers and CI with a newer toolchain installed may silently use a different patch than intended.

Suggested change
go 1.26
go 1.26
toolchain go1.26.0


toolchain go1.26.0

require (
github.com/codeclysm/extract v2.2.0+incompatible
Expand Down
4 changes: 4 additions & 0 deletions internal/checksum/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ func CalculateChecksum(workDir string, patterns []string) (string, error) {
if err != nil {
return "", fmt.Errorf("can not read file to calculate checksum: %w", err)
}

cachedSum = fileHasher.Sum(data)
checksumCache[filename] = cachedSum

_, err = hasher.Write(cachedSum)
if err != nil {
return "", fmt.Errorf("can not write checksum to hasher: %w", err)
}

fileHasher.Reset()
}
}
Expand Down Expand Up @@ -175,6 +178,7 @@ func PersistCommandsChecksumToDisk(checksumsDir string, checksumMap map[string]s
if checksumName == DefaultChecksumKey {
filename = DefaultChecksumFileName
}

err := persistOneChecksum(checksumsDir, cmdName, filename, checksum)
if err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func getCommandsList(rootCmd *cobra.Command, out io.Writer, verbose bool) error
descr = strings.TrimSpace(descr)
}

buf.WriteString(fmt.Sprintf("%s:%s\n", cmd.Name(), descr))
fmt.Fprintf(buf, "%s:%s\n", cmd.Name(), descr)
} else {
buf.WriteString(cmd.Name() + "\n")
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func getCommandOptions(command *config.Command, out io.Writer, verbose bool) err
desc = strings.TrimSpace(option.desc)
}

buf.WriteString(fmt.Sprintf("%[1]s[%s]\n", option.name, desc))
fmt.Fprintf(buf, "%[1]s[%s]\n", option.name, desc)
} else {
buf.WriteString(option.name + "\n")
}
Expand Down Expand Up @@ -249,6 +249,7 @@ func InitCompletionCmd(rootCmd *cobra.Command, cfg *config.Config) func(cfg *con
}

completionCmd.Flags().StringP("shell", "s", "", "The type of shell (bash or zsh)")

if cfg != nil {
completionCmd.Flags().Bool("list", false, "Show list of commands [deprecated, use --commands]")
completionCmd.Flags().Bool("commands", false, "Show list of commands")
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/lsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func initLspCommand(version string) *cobra.Command {
if err := lsp.Run(cmd.Context(), version); err != nil {
return errors.Wrap(err, "lsp error")
}

return nil
},
}
Expand Down
Loading
Loading