Skip to content

Commit

Permalink
Generate clang-tidy comments in pull requests.
Browse files Browse the repository at this point in the history
Using a github action; see details
https://github.com/ZedThree/clang-tidy-review

This only runs on changed files, so clang-tidy reports are useful
and actionable.
  • Loading branch information
hzeller committed Oct 8, 2024
1 parent 5b1fe24 commit 1be8da9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ jobs:
- name: Bazel Test All (opt)
run: |
bazel test -c opt --noshow_progress --test_output=errors -- //...
- name: Create compilation DB
run: |
xls/dev_tools/make-compilation-db.sh
ls -l compile_commands.json
- name: Run clang-tidy on changes and report in PR
uses: ZedThree/clang-tidy-review@v0.19.0
with:
clang_tidy_version: 17
config_file: ".clang-tidy"

id: review
6 changes: 3 additions & 3 deletions xls/fuzzer/run_fuzz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ absl::Status RunSample(const Sample& smp, const std::filesystem::path& run_dir,
};

// Pass on verbosity flags if available.
if (int64_t verbosity = absl::GetFlag(FLAGS_v); verbosity > 0) {
argv.push_back(absl::StrCat("--v=", verbosity));
}
if (int64_t verbosity = absl::GetFlag(FLAGS_v); verbosity > 0)
argv.push_back(absl::StrCat("--v=", verbosity)); // testing clang-tidy

if (std::string vmodule = absl::GetFlag(FLAGS_vmodule); !vmodule.empty()) {
argv.push_back(absl::StrCat("--vmodule=", absl::GetFlag(FLAGS_vmodule)));
}
Expand Down

0 comments on commit 1be8da9

Please sign in to comment.