Skip to content

[CI] update clang-tidy config#4066

Merged
lalitb merged 2 commits into
open-telemetry:mainfrom
dbarker:ci_update_clangtidy_config
May 8, 2026
Merged

[CI] update clang-tidy config#4066
lalitb merged 2 commits into
open-telemetry:mainfrom
dbarker:ci_update_clangtidy_config

Conversation

@dbarker
Copy link
Copy Markdown
Member

@dbarker dbarker commented May 7, 2026

CI is failing due to clang-tidy warning limits

Changes

  • update clang tidy checks after llvm-22 upgrade
  • set new warning limits.

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

@dbarker dbarker marked this pull request as ready for review May 7, 2026 22:49
@dbarker dbarker requested a review from a team as a code owner May 7, 2026 22:49
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.10%. Comparing base (767f797) to head (62e50a7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4066      +/-   ##
==========================================
+ Coverage   82.09%   82.10%   +0.02%     
==========================================
  Files         385      385              
  Lines       15989    15989              
==========================================
+ Hits        13124    13126       +2     
+ Misses       2865     2863       -2     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbarker dbarker added the pr:please-review This PR is ready for review label May 8, 2026
@lalitb lalitb merged commit 1711410 into open-telemetry:main May 8, 2026
70 checks passed
@dbarker dbarker deleted the ci_update_clangtidy_config branch May 8, 2026 17:18
malkia added a commit to malkia/opentelemetry-cpp that referenced this pull request May 8, 2026
thc1006 added a commit to thc1006/opentelemetry-cpp that referenced this pull request May 18, 2026
…ns in otlp_populate_attribute_utils

After the clang-tidy v22 upgrade in open-telemetry#4066, four narrowing-conversion
warnings resurfaced in otlp_populate_attribute_utils.cc. The four sites
already had NOLINT suppressions for cppcoreguidelines-narrowing-conversions,
but clang-tidy v22 reports the check under its bugprone-narrowing-conversions
alias, so the suppressions no longer match.

Update the four NOLINT comments to use the bugprone- name. No behavior
change; this only adjusts a lint suppression. A fifth NOLINT at line 300
is left untouched because uint32_t to int64_t at that site is signed
widening, not narrowing, and clang-tidy v22 correctly emits no warning
there.

Ratchet:
* abiv1-preview warning_limit lowered from 418 to 414
* abiv2-preview warning_limit lowered from 424 to 420

Part of open-telemetry#2053

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
thc1006 added a commit to thc1006/opentelemetry-cpp that referenced this pull request May 18, 2026
…opulate_attribute_utils

After the clang-tidy v22 upgrade in open-telemetry#4066, four narrowing-conversion
warnings surfaced in otlp_populate_attribute_utils.cc at the four
uint64_t to int64_t call sites passing to proto set_int_value.

The original code suppressed via NOLINT(cppcoreguidelines-narrowing-conversions).
In clang-tidy v22 both bugprone-narrowing-conversions and
cppcoreguidelines-narrowing-conversions are registered as separate
aliases, and NOLINT for one alias does not suppress the report under
the other. So an alias-name-rename approach cannot silence the warnings
with a single NOLINT.

Replace the four NOLINT-suppressed implicit narrowings with explicit
static_cast<int64_t> conversions, matching the pattern established in
open-telemetry#3989, open-telemetry#3997, and open-telemetry#4013. This removes the alias dependency entirely
and makes the narrowing explicit at the call site.

The fifth NOLINT at line ~297 (uint32_t to int64_t) is signed widening,
not narrowing; clang-tidy v22 emits no diagnostic there. Left untouched.

Ratchet:
* abiv1-preview warning_limit lowered from 418 to 414
* abiv2-preview warning_limit lowered from 424 to 420

Part of open-telemetry#2053

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
thc1006 added a commit to thc1006/opentelemetry-cpp that referenced this pull request May 18, 2026
…opulate_attribute_utils

After the clang-tidy v22 upgrade in open-telemetry#4066, four narrowing-conversion
warnings surfaced in otlp_populate_attribute_utils.cc at the four
uint64_t to int64_t call sites passing to proto set_int_value.

The original code suppressed via NOLINT(cppcoreguidelines-narrowing-conversions).
In clang-tidy v22 both bugprone-narrowing-conversions and
cppcoreguidelines-narrowing-conversions are registered as separate
aliases, and NOLINT for one alias does not suppress the report under
the other. So an alias-name-rename approach cannot silence the warnings
with a single NOLINT.

Replace the four NOLINT-suppressed implicit narrowings with explicit
static_cast<int64_t> conversions, matching the pattern established in
open-telemetry#3989, open-telemetry#3997, and open-telemetry#4013. This removes the alias dependency entirely
and makes the narrowing explicit at the call site.

The fifth NOLINT at line ~297 (uint32_t to int64_t) is signed widening,
not narrowing; clang-tidy v22 emits no diagnostic there. Left untouched.

Ratchet:
* abiv1-preview warning_limit lowered from 418 to 414
* abiv2-preview warning_limit lowered from 424 to 420

Part of open-telemetry#2053

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
thc1006 added a commit to thc1006/opentelemetry-cpp that referenced this pull request May 19, 2026
…opulate_attribute_utils

After the clang-tidy v22 upgrade in open-telemetry#4066, four narrowing-conversion
warnings surfaced in otlp_populate_attribute_utils.cc at the four
uint64_t to int64_t call sites passing to proto set_int_value.

The original code suppressed via NOLINT(cppcoreguidelines-narrowing-conversions).
In clang-tidy v22 both bugprone-narrowing-conversions and
cppcoreguidelines-narrowing-conversions are registered as separate
aliases, and NOLINT for one alias does not suppress the report under
the other. So an alias-name-rename approach cannot silence the warnings
with a single NOLINT.

Replace the four NOLINT-suppressed implicit narrowings with explicit
static_cast<int64_t> conversions, matching the pattern established in
and makes the narrowing explicit at the call site.

The fifth NOLINT at line ~297 (uint32_t to int64_t) is signed widening,
not narrowing; clang-tidy v22 emits no diagnostic there. Left untouched.

Ratchet:
* abiv1-preview warning_limit lowered from 418 to 414
* abiv2-preview warning_limit lowered from 424 to 420

Part of open-telemetry#2053

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please-review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants