Skip to content

Moving toward v3 #283

Open

Description

@2bndy5

This is a checklist of tasks that should be implemented in v3. Work for this shall live in the v3 branch until ready for deployment.

  • switch to cpp-linter-rs project. We could use a standalone binary instead of the python binding, but dependabot would not know what version is used. Alternatively, we could use the node.js binding, but packaging that in cpp-linter-action needs further investigation (because of native distributions on npmjs.org).
  • switch clang-tools installer to non-python dependent project. I have written clang-tools-manager which does exactly what cpp-linter-action and clang-tools-pip does. And it is built into cpp-linter-rs, so
    1. there's no additional executable binary needed.
    2. The platform-specific steps in cpp-linter-action about installing clang tools are not needed.
    3. A clang tool is only installed (after file detection/filtering) if it is needed.
  • Write a migration guide for v2 -> v3 and v1 -> v3. This should include changes to inputs only. Users can find information about outputs in our regular documentation because there are no breaking changes in the outputs.

Backward compatibility

We can retain v2 in a non-default branch (named v2). This would allow current workflows to keep working with

- uses: cpp-linter/cpp-linter-action@v2

Dependabot updates will not update non-default branches, but that's ok. The cpp-linter-rs project will begin uploading releases to pypi, so the cpp-linter version on v2 branch should be pinned to the last pure-python release.

Activity

  1. added
    enhancement
    semver:major
    help wanted
    on Nov 27, 2024
  2. shenxianpeng commented on Oct 31, 2026

    @shenxianpeng
    Member

    I read through the updated v3.0.0-rc0 branch (e8ce711) before setting up an end-to-end run in test-cpp-linter-action. Three things I think will show up there:

    1. Every run fails on --jobs. The branch pins cpp-linter==2.0.0rc23 from TestPyPI, which was built before build(deps): bump mkdocs-ng-material to 9.8.2 #536 (cpp-linter-rs), so it rejects --jobs. The action always passes --jobs=${{ inputs.jobs }}. Running rc23 locally with --jobs=0 gives error: unexpected argument '--jobs'. A Python rc built from current main should fix it, or the action could stop passing --jobs since it is ignored anyway.
    2. auto-fix never commits. v2 leaves the worktree untouched, so git ls-files --modified returns nothing and git apply is never reached. Also, extra arguments to git apply are read as more patch files, not as paths to limit the patch to. Maybe something like git apply --include=<pathspec> $FIX_PATCH_PATH, then list what changed?
    3. tidy-review / format-review don't take effect. pr_review is computed from all three inputs but not used; the args still use --pr-review=($env.INPUT_PR_REVIEW).

    Once there is a Python rc with #536–#541, I'm happy to run the full e2e (PR review, thread comment, step summary, SARIF, auto-fix on Linux/macOS/Windows) and post the results here.

  3. 2bndy5 commented on Oct 31, 2026

    @2bndy5
    CollaboratorAuthor
    1. yeah, that was an oversight when rebasing this branch onto main (which had all the INPUTS_* env changes). I can do another release crusade in the cpp-linter-rs repo, then bump this branch accordingly.
    2. I missed the git ls-files --modified command; that should be removed.
    3. This was intentional. It doesn't make sense to pass --tidy-review, --format-review, and --pr-review when --pr-review replaces the other two. I checked locally, and clap does not allow specifying the same arg 3 times:
      cpp-linter --pr-review --tidy-review --format-review
      error: the argument '--pr-review [<PR_REVIEW>]' cannot be used multiple times
      I'm not sure there is a good way around that. I have to investigate (see what's available in clap API). I added the aliases for backward compatibility, but I hadn't considered the case where multiple aliases are passed.
  4. shenxianpeng commented on Nov 3, 2026

    @shenxianpeng
    Member

    Thanks for the rc.25 release crusade! When you have time, could you bump the v3.0.0-rc0 branch to it? The branch is still on e8ce711, which pins cpp-linter==2.0.0rc23, so every run still fails on --jobs. The two items from above would go in the same update:

    • pin cpp-linter==2.0.0rc24 (the Python package of rc.25, on TestPyPI)
    • remove the git ls-files --modified step

    Meanwhile I'll run the end-to-end tests in test-cpp-linter-action against rc.25 (PR review, thread comment, step summary, SARIF, auto-fix patch on Linux, macOS and Windows) and post the results here, so we know what's left before GA.

  5. 2bndy5 commented on Nov 3, 2026

    @2bndy5
    CollaboratorAuthor

    v3.0.0-rc0 branch now on latest v2 rc release. I also removed the --modified flag from git ls-files command.

  6. shenxianpeng commented on Nov 5, 2026

    @shenxianpeng
    Member

    Thanks for the update! I ran v3.0.0-rc0 @ 34d5522 (cpp-linter rc24 / rc.25) end to end in cpp-linter/test-cpp-linter-action#69.

    Works: with the workaround below, the v3 counts match v2 exactly on ubuntu x64/arm64, macOS and windows x64 (clang 21: 14 total, 15 on Windows), and windows-11-arm works too. clang 12/17/23 run fine. jobs now only prints the deprecation warning. The PR review, thread comment, step summary and summary-output-file all work.

    Three things still break:

    1. Every run fails unless summary-output-file is set. The action always passes --summary-output-file= and --database=, and rc.25 rejects an empty path:
      error: a value is required for '--summary-output-file <PATH>' but none was supplied (log). Once that's set, an unset database fails the same way. Since summary-output-file is empty by default, every default workflow fails. Either pass these options only when they're set (database, summary-output-file, probably extra-args), or make cpp-linter treat an empty value as unset.
    2. auto-fix fails at git apply. git apply $env.FIX_PATCH_PATH ...$modified treats every source file after the patch as another patch: error: No valid patches in input, exit 128 (log). Running ^git apply $env.FIX_PATCH_PATH on its own before the git ls-files line fixes it.
    3. tidy-review: true alone gives no review. $pr_review combines the three inputs but is never used: the action still passes --pr-review=($env.INPUT_PR_REVIEW). With rs#547 cpp-linter accepts the combination, so --pr-review=($pr_review) should do it. (Only if you want the deprecated aliases to keep working in v3.)

    Minor, in cpp-linter-rs: on ubuntu the log says [ERROR]: Failed to install clang-tidy-21 via apt: followed by Successfully installed. It looks like apt's "does not have a stable CLI interface" warning on stderr gets logged as an error.

    The matrix job ran with summary-output-file set everywhere as a workaround; without it every job failed at item 1.

  7. 2bndy5 commented on Nov 6, 2026

    @2bndy5
    CollaboratorAuthor

    ok, I updated the branch again.

    1. summary-output-file and database are conditionally passed if the value given is not empty.
    2. git apply is done before git ls-files I added back the --modified arg to better filter files in git add
    3. switched the --pr-review value to the combined $pr_review arg in the nu script.
  8. pinned this issue on Nov 10, 2026
  9. Alexolut commented on Nov 12, 2026

    @Alexolut

    Thanks @2bndy5 for fixing the issue here. It works. However, the following info messages slightly confused me:

      [ INFO]: Trying to install clang-format v18.1.8 using Apt package manager.
      [ INFO]: Apt package manager does not have a version of clang-format matching ^18.1.8 installed.
      [ INFO]: Successfully installed clang-format v18.1.8 using Apt package manager.
      [ INFO]: Installed clang-format version 18.1.8 matches the requirement ^18.1.8.
      [ INFO]: Using clang-format version 18.1.8
    

    In particular:

    [ INFO]: Apt package manager does not have a version of clang-format matching ^18.1.8 installed.
    [ INFO]: Successfully installed clang-format v18.1.8 using Apt package manager.

    If there's no version on Apt package manager, how it can be installed using Apt package manager?

    Another minor issue - extra space before INFO in brackets: [ INFO]:

  10. 2bndy5 commented on Nov 12, 2026

    @2bndy5
    CollaboratorAuthor

    Another minor issue - extra space before INFO in brackets: [ INFO]:

    The extra space is intentional; log levels are right justified text.

    If there's no version on Apt package manager, how it can be installed using Apt package manager?

    I think you lucked out and actually got v18.1.8 by installing clang-format-18. When it says "Using clang-format version 18.1.8", that version is the number gotten from clang-format-18 --version output.

    I could probably tell more about what happened with apt if the verbosity was enabled (for debug level logs).

  11. Alexolut commented on Nov 13, 2026

    @Alexolut

    The only new line I got when I've set debug verbosity:

    [ INFO]: Trying to install clang-format v18.1.8 using Apt package manager.
    [ INFO]: Apt package manager does not have a version of clang-format matching ^18.1.8 installed.
    [DEBUG]: Running `sudo apt install -y clang-format-18`
    [ INFO]: Successfully installed clang-format v18.1.8 using Apt package manager.
    [ INFO]: Installed clang-format version 18.1.8 matches the requirement ^18.1.8.
    [ INFO]: Using clang-format version 18.1.8
    

    I've tried another clang-format version (18.1.7). Results are below:

    Via preliminary step by pip I'm able to install exact 18.1.7:

    pip install clang-format==18.1.7

    After that it will be used by linter:
    [ INFO]: Found clang-format version 18.1.7 at path: "/usr/local/bin/clang-format-18"
    [ INFO]: Using clang-format version 18.1.7

    However, it's not possible to install exact 18.1.7 via cpp-linter-action only (if there's no preliminary step with pip install):

    [ INFO]: Trying to install clang-format v18.1.7 using Apt package manager.
    [ INFO]: Apt package manager does not have a version of clang-format matching ^18.1.7 installed.
    [DEBUG]: Running `sudo apt install -y clang-format-18`
    [ INFO]: Successfully installed clang-format v18.1.7 using Apt package manager.
    [ INFO]: Installed clang-format version 18.1.8 matches the requirement ^18.1.7.
    [ INFO]: Using clang-format version 18.1.8
    

    Messages look incorrect: "Successfully installed v18.1.7" but after that "Using version 18.1.8".

    I expect to have installed exact clang-format version that I requested, or fail otherwise.

  12. 2bndy5 commented on Nov 13, 2026

    @2bndy5
    CollaboratorAuthor

    Version also accepts semantic ranges (ie >=18,<19). So maybe you want to try =18.1.7. It should still run through apt (and other package managers detected), then fall back to installing via PyPI wheels (or static binaries failing that).

    When you say only version: 18.1.7, it gets interpreted as ^18.1.7 which is technically satisfied by 18.1.8. This was meant to preserve backward compatible behavior with current cpp-linter-action v2.

  13. shenxianpeng commented on Nov 18, 2026

    @shenxianpeng
    Member

    @2bndy5 v3 is the one release where input defaults can change, and the v3 branch still has the v2 ones. Here is a proposal; each one is your call.

    Input Now (v2 and v3 branch) Proposed for v3 Why
    style llvm file Use the project's own .clang-format. clang-format falls back to LLVM style when there is none.
    tidy-checks 8 check groups '' Use the project's own .clang-tidy, else clang-tidy's defaults. The README quick start already sets ''.
    lines-changed-only false true Same as the CLI default in v2. A PR is only flagged for lines its author touched.
    step-summary false true Needs no permissions and works on PRs from forks.
    version 21 23 (latest major at release) v3 installs any version itself, so the default can follow LLVM.
    new strict none true Fail the step when checks fail.

    The last one matters most. Today a workflow needs an extra if: steps.linter.outputs.checks-failed > 0 step to fail, so users who copy only the action get a green PR with format errors. The popular format-only actions fail by default, so users expect that. --strict from cpp-linter/cpp-linter-rs#584 (in rc.26) already does this after the feedback and outputs are posted. In the action it probably needs to run after auto-fix, so the step could check checks-failed itself at the end instead of passing --strict.

    Two smaller additions while inputs are changing: sarif-file (for github/codeql-action/upload-sarif) and code-quality-file once it is released.

    Once the defaults are settled, I'll draft the v2 -> v3 input migration guide (the last box above).

  14. 2bndy5 commented on Nov 18, 2026

    @2bndy5
    CollaboratorAuthor

    I'm fine with most of these new defaults except the strict and version.

    • --strict changing to true would be a noticable change that requires explicit opt-out. I'd prefer strict default to false for best backward compliant behavior.
    • --version default should seek the latest release available at runtime not compile time. I don't expect to check registries for a new major version at run time. I just thought we can use the latest major version in the static binaries version range that is embedded in cpp-linter-rs as a const/lazy static.
  15. shenxianpeng commented on Nov 18, 2026

    @shenxianpeng
    Member

    For version I'll go with your approach: default to the newest major in the static binaries range built into cpp-linter-rs. I can open the cpp-linter-rs PR for that.

    On strict, it might still be worth considering true, because most users already make the job fail themselves. I used AI to check the 565 public repos that use this action:

    • 57% already fail the job when checks fail, with an extra step that reads checks-failed. Among the repos that read that output at all, it's 70%.
    • Among repos with a push in the last 12 months, it's 64%.
    • They follow our README. Before Feb 2024 the README example only echoed the result: 21% of the 141 repos set up from that era fail the job. After the example started failing the job, 70% of the 424 newer repos do.

    So strict: true matches what most users already do and what our docs tell them to do. The cost is that about 43% of users would need strict: false when they move to v3. I'd put that at the top of the migration guide, and since moving to v3 already means editing the workflow, it's one more line.

    One more thing from the same data: 62 of these repos use @main or @master, so they get v3 and all its changes as soon as the v3 branch is merged into main. That may be worth a heads-up in the last v2 release notes.

    If you still prefer false, I'll put strict: true in the README quick start instead.

  16. removed
    help wanted
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementsemver:major

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions