From cd064cbb4417f92867418b483d06d4edcf32dbd5 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Wed, 30 Sep 2026 12:54:28 +0300 Subject: [PATCH] docs: explain include paths for third-party libraries and drop a private-repo claim Follows up on @2bndy5's comments on #62. **Third-party libraries in the clang-tidy guide.** Step 2 said to install dependencies before the configure step, but not why: clang-tidy finds a library's headers only through the `-I` paths the compiler gets for each file, which it reads from the compilation database. The bullet now says so, and shows how to pass those paths with `extra-args` when there is no build system (`-Ithird_party/fmt/include`, written without a space because `extra-args` splits on spaces). **Private repositories on the home page.** #70 said the step summary also works "in private repositories, where thread comments are turned off". That came from the note on `thread-comments` in cpp-linter-action's `action.yml`, but cpp-linter has no code that turns thread comments off for private repositories; its requests ask for `application/vnd.github.raw+json`, the change that addressed cpp-linter-action#142. As discussed on #62, whether thread comments work on a private repository still needs a test run, so the card no longer says anything about private repositories. --- .../2026-09-20-clang-tidy-pull-requests-github-actions.md | 7 +++++-- docs/overrides/home.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/blog/posts/2026-09-20-clang-tidy-pull-requests-github-actions.md b/docs/blog/posts/2026-09-20-clang-tidy-pull-requests-github-actions.md index e544037..5ffd258 100644 --- a/docs/blog/posts/2026-09-20-clang-tidy-pull-requests-github-actions.md +++ b/docs/blog/posts/2026-09-20-clang-tidy-pull-requests-github-actions.md @@ -107,8 +107,11 @@ language standard of the real build. It reads them from a compilation database, Two things commonly go wrong here: -- **Third-party dependencies.** If the configure step runs `find_package(Foo)`, install - `libfoo-dev` (or restore your vcpkg/Conan cache) before it, exactly as your build job does. +- **Third-party libraries.** clang-tidy finds a library's headers only through the `-I` paths + the compiler gets for each file, and it reads those from the database. Install the library + before the configure step, as your build job does (`libfoo-dev`, or your vcpkg or Conan cache), + so `find_package(Foo)` succeeds and its include paths are recorded. Without a build system, add + the paths to `extra-args` yourself, for example `-Ithird_party/fmt/include`. - **Generated headers.** Protobuf output, `config.h` and similar files only exist after the build step that produces them. Build those targets before running clang-tidy. diff --git a/docs/overrides/home.html b/docs/overrides/home.html index bdbc9a7..d81922f 100644 --- a/docs/overrides/home.html +++ b/docs/overrides/home.html @@ -282,7 +282,7 @@

Thread Comment

Step Summary

step-summary -

Set step-summary: true and the same report is added to the job summary of the workflow run. It needs no write access, so it also works on pull requests from forks and in private repositories, where thread comments are turned off.

+

Set step-summary: true and the same report is added to the job summary of the workflow run. It needs no write access, so it also works on pull requests from forks.