Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable usage of custom Clang-Tidy version #839

Open
ardabbour opened this issue Aug 10, 2023 · 2 comments
Open

Enable usage of custom Clang-Tidy version #839

ardabbour opened this issue Aug 10, 2023 · 2 comments

Comments

@ardabbour
Copy link

It would be great to use a custom version of Clang-Tidy, especially given that clang-tidy-10, which is the default version of ubuntu:20.04, raises a clang-diagnostic-error on several actionlib headers. As a workaround, one can do something like this:

variables:
  BEFORE_CLANG_TIDY_CHECKS : |
    if [ "$EUID" -ne 0 ] && command -v sudo > /dev/null; then
      sudo apt-get -qq install -y --no-upgrade --no-install-recommends clang-tidy-12
      sudo ln -sf $(which clang-tidy-12) $(which clang-tidy)
    else
      apt-get -qq install -y --no-upgrade --no-install-recommends clang-tidy-12
      ln -sf $(which clang-tidy-12) $(which clang-tidy)
    fi

But it would waste less CI minutes and overall be cleaner if there was a way to choose the Clang-Tidy version of interest, as is done with Clang-Format.

@mathias-luedtke
Copy link
Member

Why don't you use ADDITIONAL_DEBS?
Do other versions not setup set themselves as default?

@ardabbour
Copy link
Author

I believe the version used for setup changes depending on the base OS, whatever the default version is gets aliased to the clang-tidy command, which is then used for the checks. Even if the required version is installed via ADDITIONAL_DEBS, the clang-tidy command used later on will trigger the OS's default Clang-Tidy version. Also, installing the default version is a (minor) waste of CI time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants