Skip to content

Enable clang-tidy tooling - #91

Open
colin-higgins wants to merge 6 commits into
mainfrom
colin.higgins/static-analysis-groundwork
Open

colin-higgins wants to merge 6 commits into
mainfrom
colin.higgins/static-analysis-groundwork

Conversation

@colin-higgins

@colin-higgins colin-higgins commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Add a shared clang-tidy baseline and a CI job that fails on findings, so PRs cannot merge with tidy violations.

Co-authored-by: Cursor <cursoragent@cursor.com>
@colin-higgins colin-higgins self-assigned this Sep 24, 2026
@colin-higgins
colin-higgins requested a review from a team as a code owner September 24, 2026 14:54
@colin-higgins
colin-higgins requested review from xlamorlette-datadog and removed request for a team September 24, 2026 14:54
Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e200618b64

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/dev.yml
clang-tidy:
runs-on: ubuntu-22.04
container:
image: ghcr.io/datadog/httpd-datadog/devcontainer:main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Install clang-tidy in the CI container

This image is built from .devcontainer/Dockerfile, whose apk add list installs clang and llvm but not the extra-tools package that provides clang-tidy. Every new pull-request job therefore reaches scripts/clang-tidy.sh, fails its tool lookup, and exits before doing any analysis. Install clang-tidy in the devcontainer image or in this job.

Useful? React with 👍 / 👎.

Comment thread scripts/clang-tidy.sh Outdated
Comment on lines +43 to +44
mapfile -t files < <(find mod_datadog/ test/unit-test/ \
-type f \( -name '*.cpp' -o -name '*.c' \))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Analyze the RUM translation units

The ci-dev preset leaves HTTPD_DATADOG_ENABLE_RUM off, so CMake does not add the RUM sources to mod_datadog and creates no compile-command entries for them. This find still passes all three RUM files to clang-tidy; clang-tidy skips files without a matching compile command and returns success. As a result, changes under mod_datadog/src/rum are silently excluded from the new PR check. Generate a RUM-enabled compilation database for this job, or explicitly limit the check to the configured source set.

Useful? React with 👍 / 👎.

@datadog-datadog-prod-us1

This comment has been minimized.

colin-higgins and others added 4 commits September 24, 2026 11:46
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@colin-higgins

Copy link
Copy Markdown
Member Author

The two failures don't seem related.
dd-gitlab/build:amd64
dd-gitlab/build:amd64
dd-gitlab/build:arm64
dd-gitlab/build:arm64

Failed to clone 'deps/inject-browser-sdk' due to 403 forbidden error: CI caller from public repository may not access private repositories.

@xlamorlette-datadog xlamorlette-datadog 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.

Before handling this PR, we should finalize the mother PR in dd-trace-cpp: DataDog/dd-trace-cpp#372.

@xlamorlette-datadog

Copy link
Copy Markdown
Collaborator

The two failures don't seem related.
dd-gitlab/build[…]

Indeed! This has been fixed.

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.

2 participants