cpp-linter / cpp-linter-action

A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of file-annotations, thread-comments, workflow step-summary, and Pull Request reviews.

Home Page:https://cpp-linter.github.io/cpp-linter-action/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the default version of clang-tools to v12

shenxianpeng opened this issue · comments

I guess the default version should not be empty when run it as package.

I also would like to change the default version to the latest clang version, at least not v10, maybe v12 or higher.

This default is different from the action.yml because under Windows the version value is incorrect if the value is a digit. In Windows, clang tools' installations do not provide a version alias like clang-tidy-12. It can only be called by

  • clang-tidy when added to the OS's PATH env var
  • specifying the path to the executable like path\to\v12\bin\clang-tidy.exe

The default here (when used as a package) ensures that whatever version is installed is the one that is used despite the OS, as long as it was added to the PATH.

I have no objections to changing the default in action.yml to v12.

I see ... OK, I'll change default version to v12.

regarding clang-tools-pip

It might be a good idea to create the binaries using .exe suffix (see cpp-linter/clang-tools-pip#11) and a link to the binary that doesn't use the version in the title.

(venv) PS path > clang-tools -i 12
(venv) PS path > ls venv/Scripts
clang-format-12.exe
clang-format.lnk
clang-tidy-12.exe
clang-tidy.lnk

Though, this might cause conflicts if the unspecified directory (-d) is always sys.executable and multiple versions are installed.

that doesn't use the version in the title.

Do you mean to type clang-format or clang-tidy can execute the clang-format-12.exe or clang-tidy-12.exe?
If multiple versions are installed? which binary should be linked?

If unspecified deriectory(-d) it should be fine because the binary name is different.

PS C:\Users\xshen> clang-tools --install 13
Don't have permission to install clang-format-13 to c:\program files\python38.             Try to run with the appropriate permissions.
PS C:\Users\xshen> clang-tools --install 12
Don't have permission to install clang-format-12 to c:\program files\python38.             Try to run with the appropriate permissions.

To reduce the number of issues for this project.

I have moved comments to cpp-linter/clang-tools-pip#11 when the issue has been merged.