-
Notifications
You must be signed in to change notification settings - Fork 4
/
.clang-tidy
112 lines (110 loc) · 7.07 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright (c) Team CharLS.
# SPDX-License-Identifier: BSD-3-Clause
# The approach for using clang tidy is to enable all warnings unless it adds no practical value to the CharLS projects
# Having all warnings enables helps to find problems when new code is added to the project. Some warnings are however
# to noisy and adding NO_LINT suppressions make the code less readable.
#
# -fuchsia-* => Rationale: Rules only apply to Fuchsia projects and are out of scope for CharLS
# -google-* => Rationale: Rules only apply to Google projects and are out of scope for CharLS
# -android-* => Rationale: Rules only apply to Android projects and are out of scope for CharLS
# -llvmlibc-* => Rationale: Rules only apply to LLVM Libc and are out of scope for CharLS
# -llvm-header-guard => Rationale: #pragma once is used
# -hicpp-no-array-decay => Rationale: alias for cppcoreguidelines-pro-bounds-constant-array-index
# -hicpp-signed-bitwise => Rationale: Bad test, types are checked, not values.
# -hicpp-vararg => Rationale: Alias
# -hicpp-avoid-c-arrays => Rationale: Alias
# -hicpp-multiway-paths-covered => Rationale: switch is often the logical choice.
# -clang-diagnostic-c++98-compat* => Rationale: jpegls-wic-codec targets C++17
# -clang-diagnostic-c++98-c++11-compat => Rationale: jpegls-wic-codec targets C++17
# -clang-diagnostic-c++98-c++11-c++14-compat => Rationale: jpegls-wic-codec targets C++174
# -clang-diagnostic-unused-macros => Rationale: Macros defined in header are reported as problem
# -clang-diagnostic-sign-conversion => Rationale: warning will be enabled in additional steps
# -clang-diagnostic-switch-enum => Rationale: options are handled by default case
# -clang-diagnostic-exit-time-destructors => Rationale: Acceptable construction
# -clang-diagnostic-pragma-once-outside-header => Rationale: Generates false warnings for usage in header files
# -clang-diagnostic-ctad-maybe-unsupported => Rationale: Trust CTAD usage.
# -clang-diagnostic-language-extension-token => Rationale: COM programming with MSVC requires usage of some extensions (__uuidof for example)
# -clang-diagnostic-missing-prototypes => Rationale: false warning, complains about DllMain
# -clang-analyzer-core.NonNullParamChecker => Rationale: cannot be effective disabled, already checked by other checkers.
# -clang-analyzer-core.NullDereference => Rationale: false warnings, already checked by other checkers that work better.
# -misc-non-private-member-variables-in-classes => Rationale: design can be ok, manual review is better
# -misc-unused-using-decls => Rationale: false warning when using array with CTAD
# -modernize-use-trailing-return-type => Rationale: A style recommendation, this style is selected for CharLS
# -modernize-avoid-c-arrays => Rationale: Alias for cppcoreguidelines-avoid-c-arrays
# -readability-magic-numbers => Rationale: To critical rule, used numbers are logical
# -readability-named-parameter => Rationale: to many non problematic warnings
# -readability-implicit-bool-conversion => Rationale: style issue
# -cppcoreguidelines-avoid-magic-numbers => Rationale: Alias
# -cppcoreguidelines-pro-bounds-pointer-arithmetic => Rationale: usage is required in codec implementation
# -cppcoreguidelines-pro-type-reinterpret-cast => Rationale: To strict for conditions that require its usage
# -cppcoreguidelines-macro-usage => Rationale: Many false warnings
# -cppcoreguidelines-pro-bounds-array-to-pointer-decay => Span is not available
# -cppcoreguidelines-pro-type-const-cast => Rationale: const cast is needed for legacy functions
# -cppcoreguidelines-pro-type-union-access => Rationale: std::variant not an option as target is C++14
# -cppcoreguidelines-non-private-member-variables-in-classes => Warning is too strict, manual review code review is preferred
# -cppcoreguidelines-pro-bounds-constant-array-index => gsl:at is not used by design
# -cppcoreguidelines-pro-type-vararg => too many false warnings
# -cppcoreguidelines-init-variables => too many false warnings for variables initialized with out (other checkers are better).
# -cppcoreguidelines-avoid-c-arrays => too many false warnings, C arrays are usefull for small unitialized buffers.
# -cert-msc32-c => Rationale: predictable seed is by design (random used for testing, not crypto)
# -cert-msc51-cpp => Rationale: alias for cert-msc32-c
# -cert-err58-cpp => Rationale: Only exception that could be thrown is out of memory
---
Checks: '*,
-fuchsia-*,
-google-*,
-android-*,
-llvmlibc-*,
-llvm-header-guard,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,
-hicpp-vararg,
-hicpp-avoid-c-arrays,
-hicpp-multiway-paths-covered,
-clang-diagnostic-c++98-compat*,
-clang-diagnostic-c++98-c++11-compat,
-clang-diagnostic-c++98-c++11-c++14-compat,
-clang-diagnostic-unused-macros,
-clang-diagnostic-sign-conversion,
-clang-diagnostic-switch-enum,
-clang-diagnostic-exit-time-destructors,
-clang-diagnostic-pragma-once-outside-header,
-clang-diagnostic-ctad-maybe-unsupported,
-clang-diagnostic-language-extension-token,
-clang-diagnostic-missing-prototypes,
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-core.NullDereference,
-misc-non-private-member-variables-in-classes,
-misc-unused-using-decls,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-readability-magic-numbers,
-readability-named-parameter,
-readability-implicit-bool-conversion,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-avoid-c-arrays,
-cert-msc32-c,
-cert-msc51-cpp,
-cert-err58-cpp'
WarningsAsErrors: false
HeaderFilterRegex: ''
FormatStyle: none
CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '2'
- key: hicpp-braces-around-statements.ShortStatementLines
value: '2'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: '1'