-
Notifications
You must be signed in to change notification settings - Fork 3
/
.clang-tidy
92 lines (88 loc) · 3.36 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Clang-tidy configuration for Zecale
# This file follows the YAML syntax, see: https://yaml.org/spec/
#
# More details on clang-tidy configuration can be found here:
# - https://stackoverflow.com/questions/54202025/where-to-find-list-of-available-options-for-clang-tidy-readability-identifier-n
#
#
# Checks removed:
#
# -modernize-avoid-c-arrays is removed because in some scenarios
# C arrays are the best data structure to use. We encourage to use
# C++ containers as much as possible, but we want to keep using
# C arrays when relevant.
#
# -modernize-use-bool-literals is removed because it is easier to
# read and implement functions processing boolean vectors/matrices
# (e.g. sha256) when using '0' and '1' instead of 'true' and 'false.
# In other contexts, we strongly encourage to use bool literals however.
#
# -modernize-use-auto is removed as a way to maximize type verbosity.
# This comes at the cost of duplications in type names (when initializing
# with a cast for instance), and makes the code a bit less maintainable and
# flexible. We consider this negligible compared to the benefits of
# manipulating variables that are explicitly typed.
#
# -modernize-use-trailing-return-type,
# -modernize-return-braced-init-list,
# These are removed since they conflict with the current code style.
#
# -modernize-pass-by-value
# -modernize-deprecated-headers
# -modernize-use-default-member-init
# -readability-redundant-member-init
# -bugprone-exception-escape
# These conflict with the current code style, or would require larger
# changes. May wish to review in the future.
#
# -readability-magic-numbers
# Disabled for now as it picks up some constants which don't necessarily need
# their own variables (for some trivial multiplication and masking) and some
# test data. May wish to review in the future.
#
# -readability-implicit-bool-conversion
# We use implicit bool conversion for specifying many constants in terms of
# `0` and `1`. (TODO: it may be a good idea to enable this to fix implicit
# conversion in conditions).
#
# -readability-named-parameter,
# We occasionally omit the name of a parameter in a function definition if the
# parameter is unused, and avoid a compiler warning. This check complains
# in these cases.
#
# -readability-identifier-naming
# TODO: Retry this (attempts to customize this to our standards failed under
# clang-tidy-10 - see CheckOptions below).
#
# -misc-non-private-member-variables-in-classes,
# TODO: Public member variables are often used in our code, and in
# dependencies. There is a good argument for not exposing these. Decide on a
# policy and update this comment.
Checks:
-*,
bugprone-*,
llvm-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-modernize-avoid-c-arrays,
-modernize-use-bool-literals,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-readability-implicit-bool-conversion,
-modernize-return-braced-init-list,
-readability-named-parameter,
-modernize-pass-by-value,
-modernize-use-default-member-init,
-bugprone-exception-escape,
-misc-non-private-member-variables-in-classes,
-readability-redundant-member-init,
-modernize-deprecated-headers,
-readability-identifier-naming,
WarningsAsErrors:
'*'
HeaderFilterRegex: 'libzecale/*.(h|hpp|cpp)'