Skip to content

[lint-monster] [Code Quality] Refactor long helper/analyzer functions in pkg/linters (32 findings) #46954

Description

@github-actions

Lint group summary

make golint-custom reports 32 custom-linter findings in pkg/linters, separate from the shared pkg/workflow + pkg/cli function-length backlog.

Representative diagnostics

  • pkg/linters/mapclearloop/mapclearloop.go: run is 125 lines
  • pkg/linters/errorfwrapv/errorfwrapv.go: run is 117 lines
  • pkg/linters/seenmapbool/seenmapbool.go: inspectBody is 116 lines
  • pkg/linters/mapdeletecheck/mapdeletecheck.go: run is 109 lines
  • pkg/linters/writebytestring/writebytestring.go: run is 92 lines

Root cause

Several analyzer run functions and related literals/helpers have accumulated traversal, reporting, and fix-generation logic in a single block.

Expected outcome

Reduce the pkg/linters long-function count by extracting narrowly-scoped helpers in the worst analyzer hotspots while preserving diagnostics and suggested-fix behavior.

Remediation checklist

  • Keep remediation scoped to pkg/linters findings in this group
  • Prioritize the highest-length analyzer files first
  • Prefer minimal helper extraction and shared utility shaping over behavior changes
  • Preserve analyzer messages, positions, and fixes
  • Validate with make golint-custom

Fused skill guidance

  • Validate fixes by running make golint-custom
  • Keep remediation scoped to findings in the assigned lint group
  • Prefer minimal, targeted code edits

Copilot execution brief

Work only on the pkg/linters long-function findings from this lint run. Start with the highest-length analyzer hotspots (mapclearloop, errorfwrapv, seenmapbool, mapdeletecheck, writebytestring) and reduce the custom-linter count through small helper extraction and localized restructuring. Preserve analyzer semantics and suggested fixes. Run make golint-custom before finishing.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • pi.dev

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "pi.dev"

See Network Configuration for more information.

Generated by 🧌 LintMonster · 20.9 AIC · ⌖ 15.7 AIC · ⊞ 4.4K ·

  • expires on Jul 27, 2026, 7:45 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions