Skip to content

Refactor pkg/stringutil by feature and centralize fuzzy separator normalization - #50478

Closed
pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/refactor-stringutil-go
Closed

pelikhan with Copilot wants to merge 1 commit into
mainfrom
copilot/refactor-stringutil-go

Conversation

Copilot AI commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

pkg/stringutil/stringutil.go had accumulated unrelated helpers, making the package harder to navigate versus the existing one-file-per-feature pattern. This change reorganizes those helpers into focused files and removes duplicated inline separator normalization in fuzzy matching.

  • String utility file decomposition

    • Moved whitespace helpers into whitespace.go:
      • NormalizeWhitespace
      • NormalizeLeadingWhitespace
    • Moved numeric/version parsing helpers into numbers.go:
      • IsPositiveInteger
      • ParseVersionValue
    • Kept general-purpose formatting/truncation helpers in the general file.
  • Fuzzy match separator normalization

    • Extracted _ → - normalization into a small helper in fuzzy_match.go.
    • Replaced duplicated inline strings.ReplaceAll(..., "_", "-") calls for target/candidate normalization with the helper.
  • Behavioral scope

    • No exported API signatures changed.
    • Refactor is package-internal organization plus local helper extraction for readability and consistency.
func normalizeFuzzySeparators(s string) string {
	return strings.ReplaceAll(s, "_", "-")
}

Copilot AI linked an issue Aug 5, 2026 that may be closed by this pull request
1 of 5 tasks
Copilot AI changed the title [WIP] Refactor stringutil.go for better organization Refactor pkg/stringutil by feature and centralize fuzzy separator normalization Aug 5, 2026
Copilot AI requested a review from pelikhan August 5, 2026 04:49
@pelikhan pelikhan closed this Aug 5, 2026
@github-actions
github-actions Bot deleted the copilot/refactor-stringutil-go branch September 4, 2026 02:03
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.

[refactor] stringutil.go grab-bag + scattered separator normalization

2 participants