pgrouting icon indicating copy to clipboard operation
pgrouting copied to clipboard

Use clang-tidy

Open lbartoletti opened this issue 3 years ago • 1 comments

clang-tidy is a useful tool for helping to keep a good code quality. I would suggest looking into the following option classes:

bugprone-
clang-analyzer-
cppcoreguidelines-
modernize-
openmp-
performance-
portability-
readability-

It can give warnings, but with -fix or --fix-errors it can even automatically apply some corrections.

The full list of options is here.

Notably, it also integrates well with IDEs (see here.

From a terminal,

use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON when calling cmake (e.g. add it to the cmake.sh)
use -p=build when calling clang-tidy, so it will know all include directories, defines etc.

Problem No problems, but

Improvement There are warnings and improvements (readability, performance, etc)

Alternatives

lbartoletti avatar Aug 08 '22 08:08 lbartoletti

[X] Performance: https://github.com/pgRouting/pgrouting/pull/2356

lbartoletti avatar Aug 08 '22 08:08 lbartoletti