-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the clang-tidy is a clang-based C++ “linter” tool.
- Loading branch information
Vitalii Arteev
committed
Sep 14, 2020
1 parent
13dc426
commit 2f55ea3
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# clang-tidy is a clang-based C++ “linter” tool. | ||
|
||
# source code: https://llvm.org/docs/GettingStarted.html#checkout | ||
# docs: http://clang.llvm.org/extra/clang-tidy/ | ||
# install clang-tidy, clang-tools using apt-get: | ||
$ sudo apt install clang-tidy clang-tools | ||
|
||
# How to use | ||
Create a build folder and jump into it: | ||
$ mkdir build && cd "$_" | ||
Run the script: | ||
$ facelift/tests/clang_tidy/test_clang_tidy.sh | ||
Results of analysis will be available in the folder | ||
$ clang_tidy/report_yy-mm-dd-hhmmss/report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -eu | ||
# for info see 'read.me' | ||
|
||
DIR_BUILD=$PWD | ||
DIR_SRC=$(cd $(dirname "$0")/../..; pwd -P) | ||
DIR_REPORT="$DIR_BUILD/clang-tidy/report_$(date +"%y-%m-%d-%H%M%S")" | ||
REPORT_ANALYZER="$DIR_REPORT/report" | ||
# Use -checks=* to see all available checks. See more settings: https://clang.llvm.org/extra/clang-tidy/ | ||
CLANG_TIDY_FLAGS="clang-tidy;-extra-arg=-std=c++14;-header-filter=.*;-p=${DIR_BUILD};-checks=*" | ||
# Build facelift with flags | ||
mkdir -p $DIR_REPORT | ||
cmake -DFACELIFT_BUILD_TESTS=ON -DCMAKE_CXX_CLANG_TIDY=${CLANG_TIDY_FLAGS} ${DIR_SRC} && cmake --build ${DIR_BUILD} 2>$REPORT_ANALYZER | ||
# Show reports | ||
echo "clang-tidy report generated: "$REPORT_ANALYZER |