Skip to content

chore(detector): remove stale fnm not-implemented comment, sentinel.go package-doc collision, dead config.FileOverlay #104

Description

@dipto0321

Summary

Three small stale-comment / dead-code residuals found during the 2026-07-03 re-review (the pass that verified fix PRs #77-#101). None affect behavior; all mislead readers. One PR, three commits or one commit — small enough for a single chore PR.

Items + fixes

1. internal/detector/fnm.go:26-49 — stale "not implemented" comment + dead sentinel error

The FNM struct doc still says:

Mutation methods (Install, Uninstall, Use, SetDefault, GlobalNpmPrefix) return an explicit "not implemented" error…

and ErrFNMNotImplemented is still declared. But all five mutation methods have been real implementations since PR #56, and nothing returns or tests that error anymore (grep -rn ErrFNMNotImplemented → declaration only).

Fix: delete ErrFNMNotImplemented; rewrite the struct doc to describe the actual implemented surface (e.g. "Install/Uninstall/Use/SetDefault shell out to fnm <cmd>; GlobalNpmPrefix resolves the per-version prefix dir"). Deleting the exported var is safe — zero references repo-wide.

2. internal/packages/sentinel.go:1 — wrong package name in doc comment

File opens with // Package sentinel implements… but the package is packages. go doc attributes this comment to package packages, so the rendered docs are wrong/confusing.

Fix: demote it to a file-level comment that doesn't collide with godoc convention — e.g. start with "Sentinel file handling: …" (any first word other than "Package"), keeping the existing explanation text. Verify only one file in the package carries the canonical // Package packages … comment.

3. internal/config/resolve.go:93-105 — superseded FileOverlay left behind

FileOverlay(cfg) (marks every field as set, which is exactly the explicit-zero-value bug) was superseded by FileOverlayFromNode (internal/config/fileoverlay.go, used in load.go:48). The old function now has zero call sites outside its own definition, and the comment at resolve.go:71 still points readers at it as "the normal way".

Fix: delete FileOverlay; update the resolve.go:71 comment to reference FileOverlayFromNode. If a coarse all-fields overlay is ever wanted for tests, tests can build an Overlay literal directly.

Acceptance criteria

  • grep -rn "ErrFNMNotImplemented\|not implemented" internal/detector/fnm.go → no hits.
  • go doc ./internal/packages shows a single, correctly-attributed package comment.
  • grep -rn "FileOverlay(" internal/ matches only FileOverlayFromNode.
  • make ci green (deletions only — no behavior change, so no new tests needed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions