open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

refactor(config): centralize supported config keys

Open amh1k opened this issue 4 months ago • 1 comments

Description

Centralizes the user-facing list of supported ocr config set keys in supportedConfigKeys.

The unknown-config-key error now derives its supported-key list from this single definition, preventing the help text from drifting when configuration options change. Existing CLI behavior and error-message content are preserved.

Type of Change

  • [ ] Bug fix (non-breaking change that fixes an issue)
  • [ ] New feature (non-breaking change that adds functionality)
  • [x] Refactoring (no functional changes)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation update
  • [ ] CI / Build / Tooling

How Has This Been Tested?

  • [x] make test passes locally
  • [ ] Manual testing (not applicable)

Additional focused test:

go test ./cmd/opencodereview -run TestSetConfigValueUnknownKey

Checklist

  • [x] My code follows the project's coding style (go fmt, go vet)
  • [x] I have performed a self-review of my code
  • [x] I have added tests that prove my fix is effective or my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [ ] I have updated the documentation accordingly (not applicable)
  • [x] I have signed the CLA

Related Issues

Closes #637

amh1k avatar Jul 31 '26 10:07 amh1k

✅ OpenCodeReview: No comments generated. Looks good to me.

github-actions[bot] avatar Jul 31 '26 17:07 github-actions[bot]

Thanks for the contribution! This has already been addressed by #655 (merged on Aug 1), which makes the same change. Since both PRs place supportedConfigKeys at different locations in the file, GitHub shows no merge conflict — but merging this would result in a duplicate variable definition and a compile error. Closing as superseded.

lizhengfeng101 avatar Aug 04 '26 06:08 lizhengfeng101