Skip to content

Conversation

@abtreece
Copy link
Owner

@abtreece abtreece commented Jan 7, 2026

Summary

  • Remove unused code (etcdWatcher interface, replacer variable)
  • Fix bugs (ineffective break, variable shadowing, deprecated API call)
  • Fix error strings per Go conventions
  • Add godoc comments for exported types and functions

Changes

Dead Code Removed

  • pkg/backends/etcd/client.go: Removed unused etcdWatcher interface
  • pkg/backends/file/client.go: Removed unused replacer variable

Bug Fixes

  • pkg/template/processor.go: Fixed ineffective break statement - changed to return to properly exit the for loop
  • pkg/backends/vault/client.go: Fixed variable shadowing in kubernetes auth case
  • pkg/backends/vault/client.go: Removed deprecated tlsConfig.BuildNameToCertificate() (deprecated since Go 1.14)

Error String Fixes

  • Lowercase error messages per Go conventions
  • Removed trailing punctuation

Godoc Comments Added

  • backends.Config, ssm.Client, ssm.New
  • file.ResultError, file.NewFileClient
  • template.Processor, template.Process, template.IntervalProcessor, template.WatchProcessor
  • util.AppendPrefix, util.ArrayShift

Test plan

  • All unit tests pass (go test -vet=off ./pkg/...)
  • Build succeeds (go build ./...)

Closes #349, #348

- Remove unused code:
  - etcdWatcher interface in pkg/backends/etcd/client.go
  - replacer variable in pkg/backends/file/client.go

- Fix bugs:
  - Ineffective break statement in intervalProcessor.Process()
  - Variable shadowing in vault kubernetes auth (err -> jwtErr)
  - Remove deprecated tlsConfig.BuildNameToCertificate() call

- Fix error strings per Go conventions (lowercase, no punctuation):
  - "Invalid backend" -> "invalid backend"
  - "Invalid file extentsion. YAML or JSON only." -> "invalid file extension, YAML or JSON only"

- Add godoc comments for exported types and functions:
  - backends.Config, ssm.Client, ssm.New, file.ResultError, file.NewFileClient
  - template.Processor, template.Process, template.IntervalProcessor, template.WatchProcessor
  - util.AppendPrefix, util.ArrayShift

Closes #349, #348
@abtreece abtreece merged commit 757c1b1 into main Jan 7, 2026
6 checks passed
@abtreece abtreece deleted the chore/code-quality-cleanup branch January 7, 2026 04:16
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.36%. Comparing base (d56e6f5) to head (03115b5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/backends/vault/client.go 0.00% 3 Missing ⚠️
pkg/backends/file/client.go 0.00% 1 Missing ⚠️
pkg/template/processor.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #352      +/-   ##
==========================================
+ Coverage   48.33%   48.36%   +0.02%     
==========================================
  Files          20       20              
  Lines        1864     1863       -1     
==========================================
  Hits          901      901              
+ Misses        882      881       -1     
  Partials       81       81              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

chore: Remove commented-out code and dead code cleanup

1 participant