Skip to content

Refactor TestLinter to use parse_named_spans() - #159

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
KyleFromNVIDIA:refactor-linter-tests
Oct 6, 2026
Merged

rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
KyleFromNVIDIA:refactor-linter-tests

Conversation

@KyleFromNVIDIA

Copy link
Copy Markdown
Member

More tech debt cleanup, use spans for another test.

More tech debt cleanup, use spans for another test.
@KyleFromNVIDIA
KyleFromNVIDIA requested a review from a team as a code owner October 6, 2026 17:46

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok yeah, nice

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: rapidsai/pre-commit-hooks/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: af41f3c6-869b-4b51-a8aa-88756cf0c7c3
📥 Commits

Reviewing files that changed from the base of the PR and between 132df86 and cf4fea6.

📒 Files selected for processing (1)
  • tests/rapids_pre_commit_hooks/test_lint.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Expanded coverage for lint fixes, including cases where content remains unchanged, multiple replacements are applied together, and conflicting replacements are detected.

Walkthrough

The lint fix test now builds its input and warning spans with parse_named_spans. It retains assertions for unchanged content, replacement results, and overlapping replacements.

Changes

Lint fix test

Layer / File(s) Summary
Replacement and overlap test cases
tests/rapids_pre_commit_hooks/test_lint.py
The test uses parsed named spans instead of hard-coded text offsets. It continues to check unchanged content, the combined replacement result, and OverlappingReplacementsError for conflicting replacements.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: bdice

Merge Risk: ⚪ Minimal · up to cf4fe

This change updates how the test constructs spans without changing its prior behavior, so no concrete merge risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: refactoring TestLinter to use parse_named_spans().
Description check ✅ Passed The description relates to the changeset by identifying technical-debt cleanup and span usage in a test.
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 unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@KyleFromNVIDIA

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit b6569b7 into rapidsai:main Oct 6, 2026
4 checks passed
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