Skip to content

fix(pre-commit): restore aot_config.py clang-format exclusion#266

Merged
demandal25 merged 1 commit into
amd-integrationfrom
fix/precommit-clang-format-exclude
Jun 24, 2026
Merged

fix(pre-commit): restore aot_config.py clang-format exclusion#266
demandal25 merged 1 commit into
amd-integrationfrom
fix/precommit-clang-format-exclude

Conversation

@demandal25

@demandal25 demandal25 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the clang-format exclude regex, 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 to 3rdparty/.*flashinfer/jit/aot_config.py, which matched nothing. As a result neither 3rdparty/ nor aot_config.py was actually excluded.

Rather than just restore the alternation, this drops the flashinfer/jit/aot_config.py clause entirely and keeps a plain 3rdparty/ exclusion. The aot_config.py clause was dead weight: it is a gitignored, generated .py file, and this hook only runs on types_or: [c++, c, cuda], so clang-format could never process it regardless.

What changed

  • .pre-commit-config.yaml — replace the broken verbose-mode regex with exclude: ^3rdparty/.*; drop the unreachable aot_config.py clause.

Test plan

  • pre-commit run -a

Copilot AI review requested due to automatic review settings June 24, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown

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 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-format hook exclude regex by using | alternation between 3rdparty/.* and flashinfer/jit/aot_config.py.

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

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
…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>
@demandal25 demandal25 force-pushed the fix/precommit-clang-format-exclude branch from 50c9657 to 1970c68 Compare June 24, 2026 14:34
@demandal25 demandal25 merged commit 221abf0 into amd-integration Jun 24, 2026
1 check passed
@demandal25 demandal25 deleted the fix/precommit-clang-format-exclude branch June 24, 2026 14:46
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