fix: resolve godot comment periods and gocritic if-else chains#119
Open
camr wants to merge 1 commit intomarcus:mainfrom
Open
fix: resolve godot comment periods and gocritic if-else chains#119camr wants to merge 1 commit intomarcus:mainfrom
camr wants to merge 1 commit intomarcus:mainfrom
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/commit/normalizer.go: conventional commit message parser/normalizer with all godoc comments properly terminated and gocritic if-else chains rewritten as switch statements.golangci.ymlenablinggocritic,godot,misspell, andwhitespacelinters so CI enforces these going forwardLint violations resolved
godot (missing trailing periods on godoc comments):
normalizer.gogocritic ifElseChain (if-else chains that should be switch):
Parse()— footerStart/bodyStart branching logic rewritten asswitch {}wrapText()— word accumulation loop rewritten asswitch {}Deferred
Three
revivewarnings are intentionally not addressed:commit.CommitTypestutter (suggest rename toType)commit.CommitMessagestutter (suggest rename toMessage)TypeFeatmissing exported const commentRenaming
CommitTypeandCommitMessagewould 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 regressionsgolangci-lint run --enable exhaustive,revive,godot,gocritic,misspell,whitespace,unconvert,prealloc ./...outputs only the three deferredrevivestutter warnings