Skip to content

Apply fixes by default - #166

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
KyleFromNVIDIA:fix-by-default
Oct 8, 2026
Merged

rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
KyleFromNVIDIA:fix-by-default

Conversation

@KyleFromNVIDIA

Copy link
Copy Markdown
Member

In practice we never use this hook without the --fix argument, and forgetting it in .pre-commit-config.yaml has only caused problems. Apply fixes by default, keep the --fix argument for backwards compatibility, and add a --no-fix argument to skip the fix step.

Also fix a small issue with verify-copyright not being able to even display the help message if git is not present.

In practice we never use this hook without the `--fix` argument,
and forgetting it in `.pre-commit-config.yaml` has only caused
problems. Apply fixes by default, keep the `--fix` argument for
backwards compatibility, and add a `--no-fix` argument to skip
the fix step.

Also fix a small issue with `verify-copyright` not being able to
even display the help message if `git` is not present.
@KyleFromNVIDIA
KyleFromNVIDIA requested a review from a team as a code owner October 8, 2026 19:35
@coderabbitai

coderabbitai Bot commented Oct 8, 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: cdeec86f-d7ff-45b1-8d7f-ce0fcde6681d
📥 Commits

Reviewing files that changed from the base of the PR and between 21e21d0 and 809c7d8.

📒 Files selected for processing (4)
  • .pre-commit-hooks.yaml
  • src/rapids_pre_commit_hooks/copyright.py
  • src/rapids_pre_commit_hooks/lint.py
  • tests/rapids_pre_commit_hooks/test_lint.py
💤 Files with no reviewable changes (1)
  • .pre-commit-hooks.yaml

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

  • Behavior Changes
    • Linting now applies fixes by default; use --no-fix to disable them.
    • The --fix option is no longer available for several validation checks.

Walkthrough

The lint command now applies fixes by default and supports --no-fix. Five pre-commit hook declarations no longer pass --fix. The copyright check imports GitPython when it runs, and copyright notices now include NVIDIA affiliates.

Changes

Fix Option Behavior

Layer / File(s) Summary
Lint fix option and validation
src/rapids_pre_commit_hooks/lint.py, tests/rapids_pre_commit_hooks/test_lint.py
The lint command enables fixing by default and supports --no-fix. Tests cover default fixing, explicit --fix, and disabled fixing across warning and long-file cases.
Pre-commit hook arguments
.pre-commit-hooks.yaml
The verify-alpha-spec, verify-codeowners, verify-dependencies, verify-hardcoded-version, and verify-pyproject-license hooks no longer pass --fix.

Copyright Hook Import

Layer / File(s) Summary
Copyright check import and annotations
src/rapids_pre_commit_hooks/copyright.py, src/rapids_pre_commit_hooks/lint.py
The copyright check imports GitPython locally instead of at module load time. The return annotation uses Optional[git.Commit]. Both copyright notices name NVIDIA’s affiliates.

Priority: ⬇️ Low

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

Change: Feature

Suggested reviewers: jameslamb

Merge Risk: ⚪ Minimal · up to 809c7

The hooks now apply fixes by default, and --fix is still accepted for backwards compatibility. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixes now apply by default.
Description check ✅ Passed The description directly explains the default fix behavior, the new --no-fix option, backward compatibility, and the verify-copyright help issue.
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.

@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.

I agree and support this, thanks.

@KyleFromNVIDIA

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 0bc3011 into rapidsai:main Oct 8, 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