File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # clang-tidy is a clang-based C++ “linter” tool.
2+
3+ # source code: https://llvm.org/docs/GettingStarted.html#checkout
4+ # docs: http://clang.llvm.org/extra/clang-tidy/
5+ # install clang-tidy, clang-tools using apt-get:
6+ $ sudo apt install clang-tidy clang-tools
7+
8+ # How to use
9+ Create a build folder and jump into it:
10+ $ mkdir build && cd "$_"
11+ Run the script:
12+ $ facelift/tests/clang_tidy/test_clang_tidy.sh
13+ Results of analysis will be available in the folder
14+ $ clang_tidy/report_yy-mm-dd-hhmmss/report
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -eu
3+ # for info see 'read.me'
4+
5+ DIR_BUILD=$PWD
6+ DIR_SRC=$( cd $( dirname " $0 " ) /../..; pwd -P)
7+ DIR_REPORT=" $DIR_BUILD /clang-tidy/report_$( date +" %y-%m-%d-%H%M%S" ) "
8+ REPORT_ANALYZER=" $DIR_REPORT /report"
9+ # Use -checks=* to see all available checks. See more settings: https://clang.llvm.org/extra/clang-tidy/
10+ CLANG_TIDY_FLAGS=" clang-tidy;-extra-arg=-std=c++14;-header-filter=. -p=${DIR_BUILD} ;-checks=*;-enable-check-profile"
11+
12+ # Build facelift with flags
13+ mkdir -p $DIR_REPORT
14+ cmake -DCMAKE_CXX_CLANG_TIDY=${CLANG_TIDY_FLAGS} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DFACELIFT_BUILD_TESTS=ON ${DIR_SRC} && cmake --build ${DIR_BUILD} 2> $REPORT_ANALYZER
15+ # Show reports
16+ echo " clang-tidy report generated: " $REPORT_ANALYZER
You can’t perform that action at this time.
0 commit comments