Repository navigation
chore/linting fixes - #11
Merged
Merged
Conversation
patdowney
commented
Jul 23, 2026
Contributor
- chore: gofmt import grouping
- fix: finalize FatalError's zerolog event so it actually logs and exits
- fix: remove inert config-watch goroutine instead of advertising unsafe hot-reload
- fix: deprecate global-Viper config path and fix contradictory precedence docs
- fix: propagate configured logger into execFunc context
- fix: use testify assertions consistently in logging and config tests
- fix: clarify intentional double logger construction in ConfigureLogOutput
- chore: fix pre-existing golangci-lint failures blocking make verify
- docs: add architecture review findings with resolution status
- chore: introduce APM
log.Fatal().Err(err) built the event but never called Msg/Send, which is what triggers zerolog's write and its os.Exit(1) side effect. FatalError was a silent no-op. Added .Msg(err.Error()) and a subprocess-based test that exercises the actual exit path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e hot-reload InitConfig called v.WatchConfig() but never registered an OnConfigChange callback anywhere in the repo, so file changes never reached the caller's config struct - the advertised hot-reload did nothing observable while leaking one fsnotify goroutine per InitConfig call. Safely re-applying changes into the caller's struct would require synchronized access (a breaking API change), so the dead feature is removed rather than half-fixed. WithoutWatchConfig is kept as a deprecated no-op for backward compatibility. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nce docs InitViperConfig/InitViperConfigWithFlagSet operate on Viper's global package-level singleton (unsafe for parallel tests/repeated calls, as the existing test comments already acknowledge), while InitConfig uses a local viper.New() instance. Mark the global-singleton functions Deprecated in favor of InitConfig rather than removing them (removal would break callers), and note their differing env-key replacer behavior. doc.go and InitViperConfig's own doc comment also stated contradictory config-merge precedence orders, neither matching Viper's actual documented precedence (verified against Viper's official docs). Rewrote both consistently. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CobraRunE passed cmd.Context() straight through to execFunc, even though InitConfig had just configured the global zerolog logger via ConfigureCmdLogger. Command bodies had no way to retrieve that logger via zerolog.Ctx(ctx) despite the library already handing them a context built for exactly this kind of propagation (cli.Context/SetOrgName/SetAppName). Wrap cmd.Context() with the configured logger before calling execFunc. Purely additive - no signature changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
logging/logging_test.go predated testify adoption in this repo and used raw t.Error/t.Errorf throughout; config_test.go mixed raw checks with testify in the same file. Converted the remaining raw assertions to assert/require, matching the style already used elsewhere in the suite (integration_test.go, initconfig_test.go). Assertion library only, no behavior change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tput log.Logger is constructed once to guarantee a writable logger while resolving file output, then again with the final output target. Add a comment so this doesn't read as duplicated/dead code in a future edit. Comment-only, no logic change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two issues predating this session's work were failing the project's make verify gate: an unchecked fmt.Fprintf return in NewVersionCommand's RunE (errcheck), and a lint-ignore comment in TestContextWithNilBase using the wrong syntax for golangci-lint (staticcheck's SA1012 was never actually suppressed). Neither is part of the architecture-review findings; fixed separately so make verify is green. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Phase 1 review findings for the cli module, now annotated with each finding's resolution commit SHA and cognitive-complexity delta from the Phase 2 pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.