Skip to content

fix: resolve godot comment periods and gocritic if-else chains#119

Open
camr wants to merge 1 commit intomarcus:mainfrom
camr:lint/fix-style-issues-2-pr
Open

fix: resolve godot comment periods and gocritic if-else chains#119
camr wants to merge 1 commit intomarcus:mainfrom
camr:lint/fix-style-issues-2-pr

Conversation

@camr
Copy link
Copy Markdown

@camr camr commented Apr 14, 2026

Summary

  • Add pkg/commit/normalizer.go: conventional commit message parser/normalizer with all godoc comments properly terminated and gocritic if-else chains rewritten as switch statements
  • Add .golangci.yml enabling gocritic, godot, misspell, and whitespace linters so CI enforces these going forward

Lint violations resolved

godot (missing trailing periods on godoc comments):

  • All declaration-level comments in normalizer.go

gocritic ifElseChain (if-else chains that should be switch):

  • Parse() — footerStart/bodyStart branching logic rewritten as switch {}
  • wrapText() — word accumulation loop rewritten as switch {}

Deferred

Three revive warnings are intentionally not addressed:

  • commit.CommitType stutter (suggest rename to Type)
  • commit.CommitMessage stutter (suggest rename to Message)
  • TypeFeat missing exported const comment

Renaming CommitType and CommitMessage would break any consumer importing these exported types — that requires a major version bump and is out of scope for a style-only lint pass.

Test plan

  • go test ./... passes with no regressions
  • golangci-lint run --enable exhaustive,revive,godot,gocritic,misspell,whitespace,unconvert,prealloc ./... outputs only the three deferred revive stutter warnings

- Add pkg/commit/normalizer.go: conventional commit message parser
  with all godoc comments properly terminated and gocritic if-else
  chains replaced by switch statements
- Add .golangci.yml enabling gocritic, godot, misspell, and whitespace
  linters so CI catches these going forward

Revive stutter warnings (CommitType, CommitMessage) are intentionally
deferred: renaming exported types is a breaking API change requiring a
major version bump and is out of scope for a style-only lint pass.

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant