Skip to content

Conversation

@dbarker
Copy link
Member

@dbarker dbarker commented Nov 23, 2025

Fixes #3538

To run clang-tidy on all header files we need to upgrade to version 20.1.0. This version adds the --exclude-header-filter argument enabling analysis of all project header files excluding the api/.../internal/absl headers.

Changes

  • upgrade the clang-tidy CI workflow and devcontainer to clang-tidy version 20 from version 18

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.95%. Comparing base (bed305f) to head (4dc631a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3762   +/-   ##
=======================================
  Coverage   89.95%   89.95%           
=======================================
  Files         225      225           
  Lines        7158     7158           
=======================================
  Hits         6438     6438           
  Misses        720      720           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--quiet;-p;${BUILD_DIR}"
make -j $(nproc)
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--header-filter=.*/opentelemetry-cpp/.*;--exclude-header-filter=.*(internal/absl|third_party|third-party)/.*;--quiet"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to put this logic (header-filter) in the top level file .clang-tidy instead ?

It is desirable to have all the clang-tidy configuration in the same place, independent of the workflow & makefiles.

-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--quiet;-p;build-${{ matrix.cmake_options }}"
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--header-filter=.*/opentelemetry-cpp/.*;--exclude-header-filter=.*(internal/absl|third_party|third-party)/.*;--quiet"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to put this logic (header-filter) in the top level file .clang-tidy instead ?

@marcalff
Copy link
Member

@dbarker

The generated reports (seen in CI) are very nice.

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.

Upgrade clang-tidy version used in CI

2 participants