Skip to content

fix: address code review issues in --commit flag (PR #267)#2

Merged
alexander-turner merged 1 commit intofeat/issues-list-by-commitfrom
claude/fix-pr-267-issues-WEbLE
Feb 9, 2026
Merged

fix: address code review issues in --commit flag (PR #267)#2
alexander-turner merged 1 commit intofeat/issues-list-by-commitfrom
claude/fix-pr-267-issues-WEbLE

Conversation

@alexander-turner
Copy link
Copy Markdown
Owner

Summary

Fixes code quality issues in the --commit flag implementation from PR DeepSourceCorp#267, and documents the feature in the README.

  • Move regexp.MustCompile to package-level var — was recompiled inside Run() on every invocation; now compiled once at init (idiomatic Go)
  • Use cobra.MarkFlagsMutuallyExclusive for --commit/--repo — replaces manual if-check with cobra's built-in declarative API
  • Fix misleading doc comment — said "full commit SHA" but validation accepts abbreviated SHAs (6-40 hex chars)
  • Add empty occurrences guard in list_run_issues.go — matches the established pattern in list_issues.go and list_file_issues.go
  • Document --commit flag in README with usage examples

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./command/issues/list/ passes

Resolves DeepSourceCorp#261

- Move regexp.MustCompile to package-level var (idiomatic Go)
- Use cobra MarkFlagsMutuallyExclusive for --commit/--repo
- Fix misleading "full commit SHA" doc comment
- Add empty occurrences guard matching existing query patterns
- Document --commit flag in README (resolves DeepSourceCorp#261)
@alexander-turner alexander-turner merged commit 4dab8c4 into feat/issues-list-by-commit Feb 9, 2026
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.

2 participants