Skip to content

Conversation

@shenxianpeng
Copy link
Collaborator

@shenxianpeng shenxianpeng commented Nov 3, 2025

closes #364

Summary by CodeRabbit

  • Documentation

    • Clarified clang-tidy version requirement (13+)
    • Removed README links to the old static-binary distribution; now points to wheel-based distribution
    • Updated license text to the full MIT wording
  • Chores

    • macOS and Windows fallbacks switched to the Python wheel distribution for clang tools
    • Installer now defaults to platform tools if no version specified, parses versions numerically, builds a per-tool install list, applies version-aware install commands, and logs steps while installing tools sequentially

@shenxianpeng shenxianpeng requested a review from a team as a code owner November 3, 2025 20:44
@shenxianpeng shenxianpeng requested review from 2bndy5 and removed request for a team November 3, 2025 20:44
@shenxianpeng shenxianpeng added the enhancement New feature or request label Nov 3, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

Replaces static-binaries fallback with Python wheel-based clang tools in README and action configuration; removes the clang-tools-static-binaries link, updates license text, and changes action.yml to parse version input, build a per-tool install list, and choose installer commands per tool/version.

Changes

Cohort / File(s) Change Summary
Documentation
README.md
Removed references and link to cpp-linter/clang-tools-static-binaries; updated fallback/install instructions to reference Python wheel-based installers (clang-tools-pip / clang-tools-wheel); replaced license text with full MIT wording.
GitHub Action configuration
action.yml
Updated version input description to note "clang-tidy only supports versions 13 and above"; treat empty version as platform default; parse numeric version; build a dynamic tool list based on inputs; loop per tool and select installer command conditionally (legacy clang-tools --install for older cases vs clang-tools-wheel --version for wheel-based installs); added per-tool logging and handling.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Verify version parsing and handling of empty/invalid strings and non-numeric suffixes.
  • Confirm correct installer selection across platforms and version boundaries (notably clang-tidy ≥13).
  • Check messaging/logs and license text correctness.

Possibly related PRs

Suggested reviewers

  • shenxianpeng

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Switch clang tools from static binaries to wheels' accurately summarizes the main change: replacing static binary installation with Python wheel-based installation for clang tools.
Linked Issues check ✅ Passed The PR implements the core objective from #364: switching clang-tools installation from static binaries to Python wheels using the clang-tools-wheel CLI approach.
Out of Scope Changes check ✅ Passed All changes are focused on switching from static binaries to wheels: README updates remove static-binaries references, and action.yml implements version-aware wheel installation logic.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-364

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29a60ef and d3e381b.

📒 Files selected for processing (1)
  • action.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 306
File: .readthedocs.yaml:9-16
Timestamp: 2025-08-13T09:33:35.208Z
Learning: Read the Docs v2 config supports `tools.python: latest` as a valid value, not just explicit version strings like "3.12". This was confirmed by a successful build in cpp-linter-action project.
📚 Learning: 2025-08-13T09:33:35.208Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 306
File: .readthedocs.yaml:9-16
Timestamp: 2025-08-13T09:33:35.208Z
Learning: Read the Docs v2 config supports `tools.python: latest` as a valid value, not just explicit version strings like "3.12". This was confirmed by a successful build in cpp-linter-action project.

Applied to files:

  • action.yml
📚 Learning: 2025-08-17T12:34:25.463Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:394-416
Timestamp: 2025-08-17T12:34:25.463Z
Learning: In the cpp-linter-action project, technical improvements can be deferred to separate PRs when they're not critical to the current changes, especially when the current implementation is known to work correctly.

Applied to files:

  • action.yml
📚 Learning: 2025-08-17T12:50:57.038Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:273-321
Timestamp: 2025-08-17T12:50:57.038Z
Learning: In Nu shell, `$in` is shorthand for a closure that takes 1 argument, so `(...) | complete | $in.exit_code == 0` is equivalent to `(...) | complete | {|in| $in.exit_code == 0}`.

Applied to files:

  • action.yml
📚 Learning: 2025-08-17T12:31:25.319Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:273-321
Timestamp: 2025-08-17T12:31:25.319Z
Learning: In Nu shell, the pattern `(...) | complete | $in.exit_code == 0` is valid syntax for checking command exit codes, where `complete` captures the command result and `$in` refers to the piped input.

Applied to files:

  • action.yml
📚 Learning: 2025-08-17T12:34:25.463Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:394-416
Timestamp: 2025-08-17T12:34:25.463Z
Learning: The cpp-linter/cpp-linter-action repository manages the downstream parsing of command-line arguments through their own cpp-linter/cpp-linter project, so passing empty string values for flags like --extra-arg="" is acceptable and known to work in their implementation.

Applied to files:

  • action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test (windows-latest, 18)
  • GitHub Check: test (windows-latest, 10)
  • GitHub Check: test (macos-latest, 20)
  • GitHub Check: test (macos-latest, 16)
  • GitHub Check: test (macos-latest, 17)
  • GitHub Check: test (ubuntu-latest, 16)
🔇 Additional comments (4)
action.yml (4)

43-43: Version constraint documentation added for clang-tidy.

The note clarifying that clang-tidy only supports versions 13 and above is helpful context for users. This aligns with the fallback logic in the installer (line 406).


381-386: Empty version handling looks correct for this step.

The code properly exits the wheel installation step early when inputs.version is empty, allowing platform-default tools to be used as documented. Note: the earlier Linux/macOS platform-specific installation steps (lines 274–335) also construct version-specific install commands. Verify they handle the empty-version case gracefully, or add platform-specific guards if needed for complete empty-version support.


393-401: Per-tool list building is clean and correct.

The conditional logic correctly:

  • Includes clang-tidy only when checks are enabled (not "-*")
  • Includes clang-format only when style is specified (not empty)

This matches the intent to install only what is needed.


405-418: No issues found—wheel availability assumption is correct.

For clang-format versions 10 through 18, the PyPI "clang-format" package provides prebuilt wheels for Linux (manylinux), macOS, and Windows. The hardcoded v9 threshold correctly marks the boundary where wheel coverage becomes universal across all platforms. The installer selection logic is sound and should not encounter silent installation failures due to missing wheels for v10+.


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 and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v16.0.6) reports: 2 file(s) not formatted
  • docs/examples/demo/demo.cpp
  • docs/examples/demo/demo.hpp
clang-tidy (v16.0.6) reports: 7 concern(s)

Have any feedback or feature suggestions? Share it here.

Copy link
Collaborator

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

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

I disagree with deprecated any version of clang-tidy before v13.

description: |
The desired version of the [clang-tools](https://github.com/cpp-linter/clang-tools-pip) to use.
Accepted options are strings which can be 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10 or 9.
clang-tidy only supports versions 13 and above.
Copy link
Collaborator

@2bndy5 2bndy5 Nov 3, 2025

Choose a reason for hiding this comment

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

woah! I thought we would fallback to the static binaries for this.

FYI, nushell can convert string to integers:

let version = "${{ inputs.version }}" | into int

And, if you need to convert the integer to a string:

let ver_str = $"v($version)"

That way you can do comparisons like $version >= 13.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The README changes should be reverted now that we have backward compatibility.

@2bndy5
Copy link
Collaborator

2bndy5 commented Nov 3, 2025

I think there's a bug in clang-tools-pip. It does not seem to match v9.0.0. Probably a logical error (>= vs >).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1a59d8 and 9de4cf2.

📒 Files selected for processing (1)
  • action.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:394-416
Timestamp: 2025-08-17T12:34:25.463Z
Learning: In the cpp-linter-action project, technical improvements can be deferred to separate PRs when they're not critical to the current changes, especially when the current implementation is known to work correctly.
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: README.md:206-211
Timestamp: 2025-08-17T13:20:51.048Z
Learning: For GitHub Actions documentation references in cpp-linter-action, prefer stable workflow syntax documentation links over "canonical" specialized pages that may redirect, as the comprehensive workflow syntax page provides better context and examples for container configuration.
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 306
File: .readthedocs.yaml:9-16
Timestamp: 2025-08-13T09:33:35.208Z
Learning: Read the Docs v2 config supports `tools.python: latest` as a valid value, not just explicit version strings like "3.12". This was confirmed by a successful build in cpp-linter-action project.
📚 Learning: 2025-08-17T12:34:25.463Z
Learnt from: 2bndy5
Repo: cpp-linter/cpp-linter-action PR: 314
File: action.yml:394-416
Timestamp: 2025-08-17T12:34:25.463Z
Learning: The cpp-linter/cpp-linter-action repository manages the downstream parsing of command-line arguments through their own cpp-linter/cpp-linter project, so passing empty string values for flags like --extra-arg="" is acceptable and known to work in their implementation.

Applied to files:

  • action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test (macos-latest, 20)
  • GitHub Check: test (windows-latest, 21)
  • GitHub Check: test (windows-latest, 13)
  • GitHub Check: test (windows-latest, 10)
  • GitHub Check: test (macos-latest, 19)
  • GitHub Check: test (macos-latest, 15)
  • GitHub Check: test (macos-latest, 9)
  • GitHub Check: test (ubuntu-latest, 15)
🔇 Additional comments (2)
action.yml (2)

43-43: Documentation update is clear and helpful.

The added constraint note aligns with the fallback logic implemented in the installation step and sets proper user expectations.


388-396: Tool selection logic is clean and efficient.

Only clang-tidy and clang-format are installed when actually needed based on inputs, avoiding unnecessary installation overhead.

@2bndy5
Copy link
Collaborator

2bndy5 commented Nov 4, 2025

uv pip install clang-format==9
  × No solution found when resolving dependencies:
  ╰─▶ Because clang-format==9.0.0 has no wheels with a matching platform tag (e.g., `win_amd64`) and you require     
      clang-format==9, we can conclude that your requirements are unsatisfiable.

      hint: Wheels are available for `clang-format` (v9.0.0) on the following platform: `manylinux1_x86_64`

Apparently, there are only wheels for linux from clang-format v9 (or older) PyPI package:

JSON API response snippet

        "6.0.1": [
            {
                "comment_text": "",
                "digests": {
                    "blake2b_256": "e371db01cf5d188d0669af9cfd9f5cf8cfb47898df6ad5c86bc008ab3b73d327",
                    "md5": "fe41668bfa155409944fc6e7dc060b42",
                    "sha256": "1b71b62346e281f96aa9d45a8892427ce1eae7783c24ac0e1efbab1d5340748d"
                },
                "downloads": -1,
                "filename": "clang_format-6.0.1-py2-none-manylinux1_x86_64.whl",
                "has_sig": false,
                "md5_digest": "fe41668bfa155409944fc6e7dc060b42",
                "packagetype": "bdist_wheel",
                "python_version": "py2",
                "requires_python": null,
                "size": 1285495,
                "upload_time": "2019-11-04T14:55:48",
                "upload_time_iso_8601": "2019-11-04T14:55:48.150563Z",
                "url": "https://files.pythonhosted.org/packages/e3/71/db01cf5d188d0669af9cfd9f5cf8cfb47898df6ad5c86bc008ab3b73d327/clang_format-6.0.1-py2-none-manylinux1_x86_64.whl",
                "yanked": false,
                "yanked_reason": null
            },
            {
                "comment_text": "",
                "digests": {
                    "blake2b_256": "166065c642879f290c4233ac75d7f91038509750347271cd135a62cf0b86019c",
                    "md5": "cd777571cebf4190bc04ed4638d68bfd",
                    "sha256": "8028c358d0838e83ea85254bedba846f2106348406c9cdc4f2724779704eedca"
                },
                "downloads": -1,
                "filename": "clang_format-6.0.1-py2.py3-none-manylinux1_x86_64.whl",
                "has_sig": false,
                "md5_digest": "cd777571cebf4190bc04ed4638d68bfd",
                "packagetype": "bdist_wheel",
                "python_version": "py2.py3",
                "requires_python": null,
                "size": 1295165,
                "upload_time": "2019-11-09T15:05:57",
                "upload_time_iso_8601": "2019-11-09T15:05:57.500683Z",
                "url": "https://files.pythonhosted.org/packages/16/60/65c642879f290c4233ac75d7f91038509750347271cd135a62cf0b86019c/clang_format-6.0.1-py2.py3-none-manylinux1_x86_64.whl",
                "yanked": false,
                "yanked_reason": null
            }
        ],
        "7.1.0": [
            {
                "comment_text": "",
                "digests": {
                    "blake2b_256": "1728feeb87d11c17d4734763db4c0a1a6939448f0c11a1713fac142e8dd2f107",
                    "md5": "ca817583469776c6b76aee6e8d058e8d",
                    "sha256": "32629996956b3e34494a926a76835e3371f10c2823c3078f5fbef08bfebbaae7"
                },
                "downloads": -1,
                "filename": "clang_format-7.1.0-py2.py3-none-manylinux1_x86_64.whl",
                "has_sig": false,
                "md5_digest": "ca817583469776c6b76aee6e8d058e8d",
                "packagetype": "bdist_wheel",
                "python_version": "py2.py3",
                "requires_python": null,
                "size": 1330841,
                "upload_time": "2019-11-09T16:17:01",
                "upload_time_iso_8601": "2019-11-09T16:17:01.797915Z",
                "url": "https://files.pythonhosted.org/packages/17/28/feeb87d11c17d4734763db4c0a1a6939448f0c11a1713fac142e8dd2f107/clang_format-7.1.0-py2.py3-none-manylinux1_x86_64.whl",
                "yanked": false,
                "yanked_reason": null
            }
        ],
        "8.0.1": [
            {
                "comment_text": "",
                "digests": {
                    "blake2b_256": "376675e3c14f22c8a7a02c7e337547e29d42bed516ba8067fdef87d3d9346e52",
                    "md5": "2053ad2ea07c26dd5ad62cb7999722d7",
                    "sha256": "d3d0d62281ace883bc6e4188f949308b8f2e4f6de8fac463e5abd1ae02c03db6"
                },
                "downloads": -1,
                "filename": "clang_format-8.0.1-py2.py3-none-manylinux1_x86_64.whl",
                "has_sig": false,
                "md5_digest": "2053ad2ea07c26dd5ad62cb7999722d7",
                "packagetype": "bdist_wheel",
                "python_version": "py2.py3",
                "requires_python": null,
                "size": 1377569,
                "upload_time": "2019-11-20T18:37:41",
                "upload_time_iso_8601": "2019-11-20T18:37:41.956369Z",
                "url": "https://files.pythonhosted.org/packages/37/66/75e3c14f22c8a7a02c7e337547e29d42bed516ba8067fdef87d3d9346e52/clang_format-8.0.1-py2.py3-none-manylinux1_x86_64.whl",
                "yanked": false,
                "yanked_reason": null
            }
        ],
        "9.0.0": [
            {
                "comment_text": "",
                "digests": {
                    "blake2b_256": "25f2d989afaf8a91385f18fd06e6202644be0bc3a1d14548c18a8ece4911e005",
                    "md5": "7b0f1d7a2785a5c2c4e9d695dfdf4583",
                    "sha256": "085342f9e238c9b03a019e20ec23f242f8795a3cca9296ab2427b1dea45e7014"
                },
                "downloads": -1,
                "filename": "clang_format-9.0.0-py2.py3-none-manylinux1_x86_64.whl",
                "has_sig": false,
                "md5_digest": "7b0f1d7a2785a5c2c4e9d695dfdf4583",
                "packagetype": "bdist_wheel",
                "python_version": "py2.py3",
                "requires_python": null,
                "size": 1375189,
                "upload_time": "2019-11-20T19:37:14",
                "upload_time_iso_8601": "2019-11-20T19:37:14.542044Z",
                "url": "https://files.pythonhosted.org/packages/25/f2/d989afaf8a91385f18fd06e6202644be0bc3a1d14548c18a8ece4911e005/clang_format-9.0.0-py2.py3-none-manylinux1_x86_64.whl",
                "yanked": false,
                "yanked_reason": null
            }
        ]

@2bndy5 2bndy5 force-pushed the fix-364 branch 2 times, most recently from cc0b06f to 29a60ef Compare November 4, 2025 19:13
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 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch clang tools from static binaries to wheels?

3 participants