-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-tidy
121 lines (119 loc) · 7.67 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
113
114
115
116
117
118
119
120
121
# 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 project
# 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.
#
# -altera-* => Rationale: Rules only apply to Alterna SDK for openCL projects and are out of scope for charls-image-test
# -fuchsia-* => Rationale: Rules only apply to Fuchsia projects and are out of scope for charls-image-test
# -google-* => Rationale: Rules only apply to Google projects and are out of scope for charls-image-test
# -android-* => Rationale: Rules only apply to Android projects and are out of scope for charls-image-test
# -llvmlibc-* => Rationale: Rules only apply to LLVM Libc and are out of scope for charls-image-test
# -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: charls-image-test targets C++23
# -clang-diagnostic-c++98-c++11-compat => Rationale: charls-image-test targets C++23
# -clang-diagnostic-c++98-c++11-c++14-compat => Rationale: charls-image-test targets C++23
# -clang-diagnostic-pre-c++14-compat => Rationale: charls-image-test targets C++23
# -clang-diagnostic-pre-c++17-compat => Rationale: charls-image-test targets C++23
# -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-diagnostic-unsafe-buffer-usage => Rationale: Too many false warnings, access is verified with other tools.
# -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
# -misc-include-cleaner => Conflicts with usage of C++ modules
# -bugprone-easily-swappable-parameters => => Rationale: design can be ok, manual review is better
# -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
# -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: '*,
-altera-*,
-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-pre-c++14-compat,
-clang-diagnostic-pre-c++17-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-diagnostic-unused-command-line-argument,
-clang-diagnostic-unsafe-buffer-usage
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-core.NullDereference,
-misc-non-private-member-variables-in-classes,
-misc-unused-using-decls,
-misc-include-cleaner,
-bugprone-easily-swappable-parameters,
-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,
-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'