Skip to content

[lint-monster] Environment-coupling custom lints (2026-07-04) #43289

Description

@github-actions

Summary

Custom lint scan found 37 environment-coupling findings where CLI/library code reads process environment directly with os.Getenv / os.LookupEnv instead of receiving configuration explicitly.

Root cause

Lower-level code is coupling itself to ambient process environment state rather than accepting configuration from callers, constructors, or narrow boundary helpers.

Affected areas

  • pkg/cli/shell_completion.go: 6 findings
  • pkg/cli/engine_secrets.go: 5 findings
  • pkg/cli/add_interactive_orchestrator.go: 3 findings
  • pkg/cli/mcp_validation.go: 2 findings
  • plus related single-file findings in pkg/workflow/workflow_data.go and multiple CLI entrypoint/helpers

Representative diagnostics

  • pkg/workflow/workflow_data.go: os.Getenv couples the library to the process environment; pass configuration explicitly instead
  • pkg/cli/add_interactive_engine.go: os.Getenv couples the library to the process environment; pass configuration explicitly instead
  • pkg/cli/outcomes_command.go: os.LookupEnv couples the library to the process environment; pass configuration explicitly instead

Expected outcome

Refactor a coherent subset of these findings so environment access lives at the outermost practical boundary and values are passed inward explicitly.

Remediation checklist

  • Keep remediation scoped to this lint group only.
  • Prefer minimal, targeted code edits over broad redesign.
  • Move environment reads to a CLI boundary, config struct, or injected helper wherever practical.
  • Update only the callers/tests required for the chosen slice.
  • Validate fixes by running make golint-custom.

Suggested starting slice

  • pkg/workflow/workflow_data.go
  • pkg/cli/add_interactive_engine.go
  • pkg/cli/outcomes_command.go
  • any directly-related callers needed to thread values through cleanly

Copilot execution notes

Use only the minimum relevant guidance: keep remediation tightly scoped to the assigned group, prefer dependency injection or explicit config threading, and stop after make golint-custom confirms progress for the touched findings.

Generated by 🧌 LintMonster · 46.1 AIC · ⌖ 4.95 AIC · ⊞ 4.4K ·

  • expires on Jul 10, 2026, 7:49 PM UTC-08:00

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions