Skip to content

Commit 8287ce3

Browse files
authored
Development: add a script that caches clang-tidy results. (openscad#5304)
A self-contained c++ program that runs clang-tidy in parallel on all files that changed since last invocation. It also takes changed headers into acccount and re-processes all files that depend on these. Fully self-contaiend, so it can be invoked as a 'script' as it compiles itself; a simple scripts/run-clang-tidy-cached.cc works (but also invoking with 'sh -c' if you wish). The results are cached in ~/.cache/clang-tidy out of tree, so different checkouts or switching between branches will also only need to process the different files. The output are two files * OpenSCAD_clang-tidy.out : contains the detailed 'compiler warning'-like output (I usually use `cat OpenSCAD_clang-tidy.out` as 'compile command' in my editor to be able to step through it. * OpenSCAD_clang-tidy.summary : A summary with all finding counts, grouped by type (see openscad#5300 for an example). A copy from run-clang-tidy-cached.cc from https://github.com/hzeller/dev-tools with configuration for openscad; so the only difference from that upstream script is the config-section: ```c++ static constexpr ConfigValues kConfig = { .cache_prefix = "OpenSCAD_", .start_dir = "src/", .file_exclude_re = "src/ext/", .revisit_brokenfiles_if_build_config_newer = false, // not clean yet. }; ``` Fixes openscad#5300
1 parent 4b645fc commit 8287ce3

File tree

2 files changed

+544
-0
lines changed

2 files changed

+544
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,4 @@ tests/data/scad/misc/use-tests.scad
9595
tests/data/svg/viewbox/viewbox_*.svg
9696
tests/regression/pdfexporttest/centered.pdf
9797
tests/regression/pdfexporttest/simple-pdf.pdf
98+
scripts/run-clang-tidy-cached

0 commit comments

Comments
 (0)