Skip to content

docs: pin the clang tool version only in additional_dependencies - #308

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-jz4xdm
Oct 23, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-jz4xdm

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

#307 showed --version=21 and additional_dependencies: [clang-format==21.1.8] together, so the version was written twice. Without --version, the hook uses the wheel that is installed in its environment (since #302), so one place is enough.

  • Quick start and the CMake and Meson examples pin the version only in additional_dependencies, like mirrors-clang-format pins it only in rev.
  • "Custom clang tool version" describes --version as the alternative: the hook picks and installs the wheel the first time it runs.
  • "Install the tool with the hook" says not to set both, and what happens if they disagree (--version wins and installs at run time).
  • The troubleshooting snippets drop --version, since they show files, --jobs and --verbose.

Checked with pre-commit: a hook with only additional_dependencies: [clang-format==20.1.8] prints "Using installed clang-format Python wheel version 20.1.8" and installs nothing at run time.

Summary by CodeRabbit

  • Documentation
    • Clarified how to pin clang-format and clang-tidy versions using dependencies or the --version option.
    • Documented that, without a specified version, hooks install the latest available wheel on first run and retain it until their environment is rebuilt.
    • Explained that --version takes precedence if pinning methods conflict and may require network access.
    • Updated the CMake and Meson examples to pin tool versions through dependencies.

Giving the version in both --version and additional_dependencies wrote it
twice. Without --version the hook uses the installed wheel, so the
examples now pin it in additional_dependencies only and describe
--version as the alternative.
@shenxianpeng shenxianpeng added the documentation Improvements or additions to documentation label Oct 23, 2026 — with Claude
@shenxianpeng shenxianpeng self-assigned this Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b9c5bee) to head (a1ca330).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #308   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          541       541           
=========================================
  Hits           541       541           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 28e69577-e366-4e75-9e70-48b3fc5b9c23
📥 Commits

Reviewing files that changed from the base of the PR and between b9c5bee and a1ca330.

📒 Files selected for processing: 3
  • README.md
  • examples/cmake/README.md
  • examples/meson/README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The documentation now describes additional_dependencies and --version as tool version selection methods. The Quick start and CMake and Meson examples pin clang-format and clang-tidy through additional_dependencies.

Changes

Tool version pinning documentation

Layer / File(s) Summary
Version selection guidance
README.md
The README describes the default PyPI wheel behavior, the two version selection methods, and --version precedence when both methods conflict.
Pinned configuration examples
README.md, examples/cmake/README.md, examples/meson/README.md
The Quick start and examples pin clang-format and clang-tidy through additional_dependencies. Other README examples remove --version arguments while retaining their other options.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to a1ca3

The documentation changes are ready to merge with no identified correctness or operational risks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main documentation change: pinning clang tool versions only through additional_dependencies.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shenxianpeng
shenxianpeng merged commit 61eb835 into main Oct 23, 2026
34 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-jz4xdm branch October 23, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant