-
Notifications
You must be signed in to change notification settings - Fork 238
/
.clang-tidy
64 lines (60 loc) · 2.01 KB
/
.clang-tidy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Configuration file to be used with clang-tidy
# This file is automatically discovered by clang-tidy when you run it on a
# file in a subdirectory.
#
# This is based on https://github.com/dealii/dealii/blob/master/.clang-tidy
#
# Usage:
#
# see ./contrib/utilities/run_clang_tidy.sh
#
#
#
# alternatively:
#
# set DEAL_II_DIR to an installation made with clang:
#
# export SRC=$PWD
# rm -rf build; mkdir build; cd build
# CXX=clang++ CC=clang cmake -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix;-quiet;-header-filter=$(realpath ..)" $SRC
# make -j 4
#
# alternatively (older cmake versions):
# export SRC=$PWD
# rm -rf build; mkdir build; cd build
# cmake -G Ninja -D CMAKE_EXPORT_COMPILE_COMMANDS=ON $SRC
# run-clang-tidy.py -p . -quiet -header-filter="$SRC/include/*"
# Rationale for disabling warnings:
#
# - modernize-concat-nested-namespaces: This is c++17 only.
# - performance-inefficient-string-concatenation: We don't care about "a"+to_string(5)+...
# - performance-no-automatic-move: All modern compiler perform the return value optimization and we prefer to keep things const.
# - modernize-return-braced-init-list: it makes sense to be verbose.
# - performance-enum-size,-performance-avoid-endl: this should not matter much
# - modernize-avoid-bind: We use std::bind() in core.cc where replacement doesn't make sense (astyle fails to format)
#
Checks: >
-*,
cppcoreguidelines-pro-type-static-cast-downcast,
google-readability-casting,
modernize-*,
-modernize-avoid-bind,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-override,
-modernize-use-default-member-init,
-modernize-use-transparent-functors,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
use-emplace,
mpi-*,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move