Skip to content

Add option to skip static analysis targets#512

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
DataDog:mainfrom
algolia:feat/skip-static-analysis-option
Mar 19, 2026
Merged

Add option to skip static analysis targets#512
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
DataDog:mainfrom
algolia:feat/skip-static-analysis-option

Conversation

@xroche

@xroche xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Summary

When building ddprof as a dependency (Conan, FetchContent, ExternalProject), the static analysis targets (cppcheck, clang-tidy, format) are unnecessary overhead. They run configure-time tool lookups and can fail if the tools aren't installed.

Following the pattern used by projects like abseil-cpp which gate dev tooling behind options, this adds a DDPROF_ENABLE_STATIC_ANALYSIS option so consumers can disable them.

This PR includes the if(TARGET cppcheck) guard from #510. If #510 lands first, this PR needs a trivial rebase. If this PR lands first, #510 becomes unnecessary.

How

Wrap the include(ClangTidy), include(Format), and include(CppcheckConfig) blocks in a single if() guard. Default is ON so existing builds are unaffected. Consumers pass -DDDPROF_ENABLE_STATIC_ANALYSIS=OFF to skip everything.

🤖 Generated with Claude Code

When building ddprof as a dependency (Conan, FetchContent), the static
analysis targets (cppcheck, clang-tidy, format) are unnecessary. They
add configure-time tool lookups and can fail if the tools aren't
installed.

Add a `DDPROF_ENABLE_STATIC_ANALYSIS` option (ON by default) so
consumers can skip them with `-DDDPROF_ENABLE_STATIC_ANALYSIS=OFF`.
Also includes the `if(TARGET cppcheck)` guard from PR #1 for safety.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@xroche
xroche force-pushed the feat/skip-static-analysis-option branch from 0e98555 to 7c43563 Compare March 19, 2026 09:16
@xroche
xroche marked this pull request as ready for review March 19, 2026 09:18
@r1viollet

Copy link
Copy Markdown
Collaborator

👋 I am totally OK with the change, though are the released versions somehow not useable ?
We try to push binaries that you can cp anywhere to avoid the problem tool chains, recompiling, linters etc...

@xroche

xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

👋 I am totally OK with the change, though are the released versions somehow not useable ?

The v0.23.0 library has issues that causes crashes on production; this should be fixed when the next release is out, but in the meantime we tried to package a "trunk" release on our side. We can wait for the next one if it is planned soon though.

@r1viollet r1viollet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@r1viollet

Copy link
Copy Markdown
Collaborator

Thanks for the update, I have some work to take recent libdatadog & then I can do a new release.
Please tell me if you still see some instabilities with recent versions 🙇

@r1viollet

Copy link
Copy Markdown
Collaborator

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Mar 19, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-03-19 09:54:43 UTC ℹ️ Start processing command /merge


2026-03-19 09:54:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 22m (p90).


2026-03-19 10:10:17 UTC ℹ️ MergeQueue: This merge request was merged

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants