Skip to content

CI: Pin linter versions in CONTRIBUTE.md and update pre-commit hook#2448

Merged
gyohuangxin merged 1 commit intomainfrom
pin-linter-versions
Mar 24, 2026
Merged

CI: Pin linter versions in CONTRIBUTE.md and update pre-commit hook#2448
gyohuangxin merged 1 commit intomainfrom
pin-linter-versions

Conversation

@gyohuangxin
Copy link
Copy Markdown
Member

Summary

  • Update recommended linter versions in CONTRIBUTE.md to match current CI:
    • black: 25.1.0 → 26.3.0
    • ruff: 0.11.11 → 0.15.7
    • clang-format: specify version 18 (18/19/20 are all supported)
  • Update .githooks/pre-commit to prefer versioned clang-format-{20,19,18} with fallback to unversioned clang-format

This ensures local dev environments stay consistent with CI, avoiding format mismatches that cause CI failures.

Test plan

  • Verify pre-commit hook finds clang-format-18 on dev machines
  • Verify black==26.3.0 and ruff==0.15.7 produce same results as CI

@gyohuangxin gyohuangxin requested review from a team and Copilot March 24, 2026 08:01
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2448 --add-label <label>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates contributor tooling guidance and the repo’s git pre-commit hook to reduce formatting mismatches between local development environments and CI, especially around clang-format selection.

Changes:

  • Update CONTRIBUTE.md recommended black/ruff versions and specify clang-format v18 (noting 18/19/20 support).
  • Enhance .githooks/pre-commit to prefer clang-format-{20,19,18} and fall back to unversioned clang-format.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
CONTRIBUTE.md Updates documented linter versions/commands to align local formatting with expected CI behavior.
.githooks/pre-commit Adds version-aware clang-format discovery with a fallback to the unversioned binary.

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

Comment thread CONTRIBUTE.md
```bash
pip install black==25.1.0 ruff==0.11.11
apt install clang-format # For C++/HIP code formatting
pip install black==26.3.0 ruff==0.15.7
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

CONTRIBUTE.md now pins black/ruff versions as “match current CI”, but CI currently runs psf/black@stable (not a specific version) and installs ruff without a version pin in .github/workflows/pre-checks.yaml. This can still lead to local/CI mismatches when CI updates. Consider either pinning CI to the same versions or rewording this section as “recommended versions” and documenting how to check the versions used in CI.

Copilot uses AI. Check for mistakes.
Comment thread CONTRIBUTE.md Outdated
Comment thread .githooks/pre-commit Outdated
done
else
echo "clang-format command not found, skipping file formatting."
echo "clang-format (18/19/20) not found, skipping file formatting. Install with: apt install clang-format-18"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The skip message is slightly inaccurate: the script also checks for unversioned clang-format, but the message only mentions (18/19/20). Consider updating it to something like “clang-format not found (tried clang-format-20/19/18 and clang-format)” so it matches the actual detection logic and gives clearer guidance.

Suggested change
echo "clang-format (18/19/20) not found, skipping file formatting. Install with: apt install clang-format-18"
echo "clang-format not found (tried clang-format-20/19/18 and clang-format), skipping file formatting. Install with: apt install clang-format-18"

Copilot uses AI. Check for mistakes.
@gyohuangxin gyohuangxin force-pushed the pin-linter-versions branch 2 times, most recently from b7a6d16 to 5af95c2 Compare March 24, 2026 08:11
Update recommended tool versions to match current CI:
- black: 25.1.0 -> 26.3.0
- ruff: 0.11.11 -> 0.15.7
- clang-format: require version 18/19/20

Update pre-commit hook to prefer versioned clang-format (20 > 19 > 18)
with fallback to unversioned clang-format.

Signed-off-by: Xin Huang <Xin.Huang@amd.com>
@gyohuangxin gyohuangxin force-pushed the pin-linter-versions branch from 5af95c2 to 8fdc829 Compare March 24, 2026 08:17
@gyohuangxin gyohuangxin merged commit a35002e into main Mar 24, 2026
11 checks passed
@gyohuangxin gyohuangxin deleted the pin-linter-versions branch March 24, 2026 09:07
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