Skip to content

refactor(sdk-go): order scoring.go declarations alphabetically - #514

Merged
peteski22 merged 1 commit into
mainfrom
refactor/scoring-declaration-order
Aug 3, 2026
Merged

refactor(sdk-go): order scoring.go declarations alphabetically#514
peteski22 merged 1 commit into
mainfrom
refactor/scoring-declaration-order

Conversation

@peteski22

@peteski22 peteski22 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reorders the top-level declarations in sdk/go/scoring.go so they follow the package's existing convention (as in store.go and options.go): the exported entry point first, then unexported declarations in alphabetical order.

The relevance method was previously hoisted directly after RankCandidates (top-down grouping). It now sits at the end of the file, giving the order:

RankCandidatesanyMatchapplyConfirmationapplyFlagjaccardSimilarityrelevance

This is a pure positional move of the method and its doc comment — no logic changes.

Verification

  • make lint — 0 issues
  • make test — full SDK suite passes
  • go build ./... — clean

Summary by CodeRabbit

  • Refactor
    • Reorganised internal scoring logic without changing functionality or user-visible behaviour.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c19feb6f-2d3a-48c2-92b4-d99dd6cdcacc

📥 Commits

Reviewing files that changed from the base of the PR and between 3582d38 and 09b6587.

📒 Files selected for processing (1)
  • sdk/go/scoring.go

Walkthrough

The KnowledgeUnit.relevance method moved to follow jaccardSimilarity in sdk/go/scoring.go. Its implementation and behaviour remain unchanged.

Changes

Relevance method reorder

Layer / File(s) Summary
Relocate KnowledgeUnit.relevance
sdk/go/scoring.go
The method moved from its earlier location to after jaccardSimilarity. Its scoring, matching, and clamping logic remain unchanged.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: alphabetically ordering declarations in sdk/go/scoring.go.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/scoring-declaration-order

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@peteski22
peteski22 force-pushed the refactor/scoring-declaration-order branch from d5a78c1 to 3582d38 Compare July 31, 2026 15:05
@peteski22
peteski22 requested a review from Copilot August 3, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors sdk/go/scoring.go by reordering top-level declarations to match the Go SDK’s apparent file organization convention: exported entry points first, followed by unexported helpers in alphabetical order. No functional logic is changed; the KnowledgeUnit.relevance method and its doc comment are moved to the end of the file.

Changes:

  • Moved KnowledgeUnit.relevance(...) below jaccardSimilarity(...) to achieve alphabetical ordering of unexported declarations.
  • Kept all method contents and documentation unchanged (pure positional move).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move the relevance method to the end of the file so top-level
declarations follow the package convention used in store.go and
options.go: the exported entry point first, then unexported
declarations in alphabetical order.

Pure positional move of the method and its doc comment; no logic
change.
@peteski22
peteski22 force-pushed the refactor/scoring-declaration-order branch from 3582d38 to 09b6587 Compare August 3, 2026 15:57
@peteski22
peteski22 merged commit ed548bc into main Aug 3, 2026
8 checks passed
@peteski22
peteski22 deleted the refactor/scoring-declaration-order branch August 3, 2026 16:04
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