Clang-tidy is part of clang tooling that's a static analyzer of
everything from "unsafe" code that violates security guidelines, to
stylistic fixes. There are many hundreds of tests. Initially we are
just enabling some basic security and correctness tests. Will add more
later.
All you need to do to run it is
make CLANG_TIDY=1
Or if running cmake directly, use -DCLANG_TIDY=1
Warning: it is a long compile.
Set up a Travis test to run clang-tidy for static analysis. But after
much trial and error, I just couldn't get it to run in the 50 minutes
that Travis allows. So for now it's disabled. But if we ever have a CI
solution that executes faster or has longer time limits, I would love to
do a full static analysis on every PR. For now, I will have to be
content running it by hand on my own machine from time to time (and for
every tagged release).
12 lines
398 B
YAML
12 lines
398 B
YAML
Checks: '-*,clang-analyzer-security*'
|
|
WarningsAsErrors: ''
|
|
HeaderFilterRegex: '(OpenImageIO/[a-zA-Z0-9_]+\.h)|(imageio)|(oiio)|(iv/)|(_pvt\.h)'
|
|
AnalyzeTemporaryDtors: false
|
|
User: lg
|
|
CheckOptions:
|
|
- key: modernize-use-nullptr.NullMacros
|
|
value: 'NULL'
|
|
- key: modernize-use-emplace.SmartPointers
|
|
value: 'OIIO::intrusive_ptr'
|
|
...
|