Skip to content

Refactor LintMain tests - #158

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

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

Conversation

@KyleFromNVIDIA

Copy link
Copy Markdown
Member

Clean up some tech debt by refactoring the LintMain tests to use factory fixtures and the named spans API, and make their usage more uniform.

Clean up some tech debt by refactoring the `LintMain` tests to use
factory fixtures and the named spans API, and make their usage more
uniform.
@KyleFromNVIDIA
KyleFromNVIDIA requested a review from a team as a code owner October 5, 2026 20:58
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: a773042f-8848-46e8-84ce-90cb7e51363e
📥 Commits

Reviewing files that changed from the base of the PR and between add61bd and 6639ee3.

📒 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
    • Improved validation of lint diagnostics, fixes, and reported locations across single-file, multi-file, long-file, binary-file, and disabled-file scenarios.
    • Updated test expectations to account for annotated source examples and calculated diagnostic positions.

Walkthrough

The lint tests now create annotated files with named spans. Check fixtures use those spans to define diagnostics and replacements. Tests calculate expected locations from file content and register checks through ctx.add_check.

Changes

Lint Test Refactor

Layer / File(s) Summary
Annotated fixtures and checks
tests/rapids_pre_commit_hooks/test_lint.py
Shared fixtures return file handles, content, and named spans. Check fixtures use the spans for warnings, replacements, and notes.
Diagnostic and fix test updates
tests/rapids_pre_commit_hooks/test_lint.py
Standard, multi-file, and binary-file tests use fixture-provided files and span-based diagnostic locations.
Long, bracketed, and disabled file tests
tests/rapids_pre_commit_hooks/test_lint.py
These tests use annotated fixtures and span-based locations. Existing long-file fix, deletion-fix, and bracket-escaped output expectations remain.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Other

Suggested reviewers: bdice

Merge Risk: ⚪ Minimal · up to 6639e

The supplied evidence identifies no issue that needs resolution before merging this test refactor; normal checks still apply.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: refactoring the LintMain tests.
Description check ✅ Passed The description explains that the tests use factory fixtures and the named spans API more uniformly.
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 132df86 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