fix(pre-commit): restore aot_config.py clang-format exclusion#266
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the pre-commit configuration for the clang-format hook by correcting the exclude regex so two exclusion patterns are properly alternated (instead of being concatenated due to verbose-regex whitespace handling).
Changes:
- Fix
clang-formathookexcluderegex by using|alternation between3rdparty/.*andflashinfer/jit/aot_config.py.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lause The exclude regex separated its two patterns with a space, which the (?x) verbose flag strips — collapsing it to a single pattern that matched nothing, so neither 3rdparty nor aot_config was excluded. Rather than just restore the alternation, drop the flashinfer/jit/aot_config.py clause entirely: it is a gitignored, generated .py file, and this hook only runs on [c++, c, cuda], so the clause could never match. Keep the 3rdparty exclusion for vendored code. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
50c9657 to
1970c68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the clang-format
excluderegex, which was a silent no-op. The two patterns were separated by a space instead of|, and under the(?x)verbose flag whitespace is stripped — so the regex collapsed to3rdparty/.*flashinfer/jit/aot_config.py, which matched nothing. As a result neither3rdparty/noraot_config.pywas actually excluded.Rather than just restore the alternation, this drops the
flashinfer/jit/aot_config.pyclause entirely and keeps a plain3rdparty/exclusion. Theaot_config.pyclause was dead weight: it is a gitignored, generated.pyfile, and this hook only runs ontypes_or: [c++, c, cuda], so clang-format could never process it regardless.What changed
.pre-commit-config.yaml— replace the broken verbose-mode regex withexclude: ^3rdparty/.*; drop the unreachableaot_config.pyclause.Test plan
pre-commit run -a