Skip to content

feat: accept latest for --version - #599

Merged
2bndy5 merged 1 commit into
mainfrom
claude/project-thread-u751ea-latest
Nov 22, 2026
Merged

2bndy5 merged 1 commit into
mainfrom
claude/project-thread-u751ea-latest

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

This is the version default you suggested on cpp-linter/cpp-linter-action#283. --version latest (any case) requests the newest major in the static binaries range that this build knows about. Today that is ^23. The value comes from MAX_CLANG_TOOLS_VERSION, which build.rs reads from the static binaries index at build time, so nothing is looked up at run time.

  • RequestedVersion::LATEST and RequestedVersion::latest() are added in clang-tools-manager, and from_str maps latest to that requirement before trying a version or a path.
  • The CLI default stays '' (the platform's installed version), so local runs and pre-commit don't start downloading clang 23. cpp-linter-action v3 can set version: latest as its input default.
  • --version help in cpp-linter and in the clang-tools binary mentions latest. cli.md is generated from the help, so it picks up the change.

Tested:

  • New test validate_version_latest.
  • cpp-linter -V latest on a machine with clang-format 18 says 18 doesn't match ^23 and installs 23.1.5.
  • clippy is clean.

Summary by CodeRabbit

  • New Features
    • Added latest as a version selection option. It resolves to the newest major version available in cpp-linter’s static binaries, including its latest minor or patch release.
    • The selected version is determined when cpp-linter is built and updates when cpp-linter is updated.
  • Documentation
    • Clarified accepted version inputs, including version requirements, latest, and paths to local installations.

`latest` requests the newest major version in the static binaries range
known at build time, so cpp-linter-action v3 can default to it instead of
a hard-coded number.
@shenxianpeng
shenxianpeng requested a review from 2bndy5 November 21, 2026 21:09
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The version parser now accepts latest in any letter case and maps it to a requirement based on the newest supported static-binary major. CLI documentation describes latest and other accepted version inputs.

Changes: Latest Version Requirements

Layer / File(s) Summary
Parse and document latest version
clang-tools-manager/src/version.rs, clang-tools-manager/src/main.rs, cpp-linter/src/cli/mod.rs
RequestedVersion::latest() builds a requirement from the greatest supported static-binary major, with VersionReq::STAR as a fallback if parsing fails. The parser recognizes latest without case sensitivity. Tests cover these behaviors. CLI documentation describes accepted inputs and the build-time value.

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

Possibly related PRs

  • cpp-linter/cpp-linter-rs#539: Reorders package-manager and PyPI evaluation in RequestedVersion::eval_tool(), a shared execution path for version requirements.
Merge Risk: Minimal · up to e17bb

This adds support for --version latest, which selects the newest static-binary major known at build time. The default behavior is unchanged. No merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat: accept latest for --version" matches the main change. The PR adds latest as a accepted value for the version option. The raw summary shows RequestedVersion::LATEST, latest()…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat: accept latest for --version" matches the main change. The PR adds latest as a accepted value for the version option. The raw summary shows RequestedVersion::LATEST, latest(), and case-insensitive handling of latest in FromStr, plus updated help text in cpp-linter. The title is short, specific, and states the primary behavior change from the user's perspective.

  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae1080da-231a-4c6d-ad35-203bd5806470
Commits

Reviewing files that changed from the base of the PR and between 166c9b7 and e17bba7.

Files selected for processing: 3

  • clang-tools-manager/src/main.rs
  • clang-tools-manager/src/version.rs
  • cpp-linter/src/cli/mod.rs

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

@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (166c9b7) to head (e17bba7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #599   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files          37       37           
  Lines        9614     9627   +13     
=======================================
+ Hits         9590     9603   +13     
  Misses         24       24           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@2bndy5 2bndy5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We'll have to remember to cut a new release when the version range changes.

@2bndy5
2bndy5 merged commit 78e4d29 into main Nov 22, 2026
113 checks passed
@2bndy5
2bndy5 deleted the claude/project-thread-u751ea-latest branch November 22, 2026 00:47
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