Skip to content

chore(lint): resolve modernize findings#719

Merged
skevetter merged 1 commit into
mainfrom
chore/modernize-lint
Jul 23, 2026
Merged

chore(lint): resolve modernize findings#719
skevetter merged 1 commit into
mainfrom
chore/modernize-lint

Conversation

@skevetter

@skevetter skevetter commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Resolves all 30 modernize linter findings reported by golangci-lint.

Changes

Applied golangci-lint --fix scoped to modernize:

  • newexpr – pointer-wrapper helpers and &x replaced with the Go 1.26 new(expr) form
  • slicesbackward – manual reverse for loops → slices.Backward (pkg/dockerfile/parse.go, verified read-only)
  • stringscutstrings.Index + slicing → strings.Cut (options.go, derp.go)
  • stringsseqstrings.Split range → strings.SplitSeq (id_darwin.go)

Removed test helper functions (ptr, strPtr, boolPtr, ptrStr) left unused after their call sites were inlined, including a pre-existing unused strPtr in extends_test.go.

Verification

  • modernize: 30 → 0
  • unused: 1 → 0
  • go build ./... passes; all tests compile

Summary by CodeRabbit

  • Refactor

    • Streamlined internal handling of configuration values, string parsing, and reverse-order processing.
    • Improved efficiency in platform-specific system identification and data processing.
    • Preserved existing behavior and public interfaces.
  • Tests

    • Simplified test setup and pointer handling across agent, container, workspace, and environment scenarios.
    • Continued coverage of configuration merging, workspace renaming, and value round trips.

Apply golangci-lint modernize autofixes: new(expr) pointer form,
slices.Backward, strings.Cut, strings.SplitSeq. Remove test helper
functions left unused after inlining.
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 7232912
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a61567769aef30008136969

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc35aaca-348d-40df-8caf-34b9e3750ec6

📥 Commits

Reviewing files that changed from the base of the PR and between aea85a4 and 7232912.

📒 Files selected for processing (13)
  • cmd/internal/agentcontainer/setup_internal_test.go
  • pkg/agent/agent.go
  • pkg/agent/delivery/legacy_shell.go
  • pkg/agent/inject.go
  • pkg/devcontainer/config/extends_test.go
  • pkg/devcontainer/run_test.go
  • pkg/devcontainer/setup/lifecyclehooks_test.go
  • pkg/devcontainer/setup_test.go
  • pkg/dockerfile/parse.go
  • pkg/machineid/id_darwin.go
  • pkg/options/options.go
  • pkg/ts/derp.go
  • pkg/workspace/rename_integration_test.go
💤 Files with no reviewable changes (1)
  • pkg/devcontainer/config/extends_test.go

📝 Walkthrough

Walkthrough

The changes modernize Go pointer construction, reverse iteration, and string parsing. Agent injection behavior and existing tests remain unchanged while local pointer helpers are removed and standard-library APIs replace index-based implementations.

Changes

Go idiom modernization

Layer / File(s) Summary
Pointer allocation in agent injection
pkg/agent/inject.go, pkg/agent/agent.go, pkg/agent/delivery/legacy_shell.go
Agent injection options use direct boolean pointer allocation, and Bool now returns new(b) while preserving preference behavior.
Direct pointers in tests
cmd/internal/agentcontainer/setup_internal_test.go, pkg/devcontainer/**/*_test.go, pkg/workspace/rename_integration_test.go
Tests replace local string and boolean pointer helpers with direct new(...) values.
Standard-library iteration and parsing
pkg/dockerfile/parse.go, pkg/machineid/id_darwin.go, pkg/options/options.go, pkg/ts/derp.go
Reverse loops use slices.Backward, and delimiter parsing uses strings.SplitSeq or strings.Cut without changing results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • devsy-org/devsy#93: Related RemoteEnv pointer usage supports nil and unset environment values.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing golangci-lint modernize findings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 7232912
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a6156772d3b45000826e9c3

1 similar comment
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 7232912
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a6156772d3b45000826e9c3

@skevetter
skevetter marked this pull request as ready for review July 23, 2026 00:27
@skevetter
skevetter merged commit bf3579d into main Jul 23, 2026
64 checks passed
@skevetter
skevetter deleted the chore/modernize-lint branch July 23, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant