-
Notifications
You must be signed in to change notification settings - Fork 74
/
.clang-tidy
123 lines (121 loc) · 7.75 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
122
123
# 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 are out of scope for CharLS
# -google-* => Rationale: Rules only apply to Google projects are out of scope for CharLS
# -android-* => Rationale: Rules only apply to Android projects 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.
# -clang-diagnostic-c++98-compat* => Rationale: CharLS targets C++17
# -clang-diagnostic-c++98-c++11-compat => Rationale: CharLS targets C++17
# -clang-diagnostic-c++98-c++11-c++14-compat => Rationale: CharLS targets C++17
# -clang-diagnostic-pre-c++14-compat => Rationale: CharLS targets C++17
# -clang-diagnostic-pre-c++17-compat => Rationale: CharLS targets C++17
# -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-global-constructors => Rationale: Acceptable construction
# -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-unused-const-variable => Rationale: false warnings for constexpr in .h files
# -clang-diagnostic-unused-command-line-argument => Rationale: false warning about option passed to MSVC
# -clang-diagnostic-declaration-after-statement => Rationale: Target is C17 and higher
# -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.
# -misc-non-private-member-variables-in-classes => Rationale: design can be ok, manual review is better
# -misc-include-cleaner => complains about no direct includes
# -modernize-use-trailing-return-type => Rationale: A style recommendation, this style is selected for CharLS
# -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
# -readability-identifier-length => Rationale: style
# -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-union-access => Rationale: usage of union is more efficient is used scenarios
# -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-init-variables => reports false warnings for out parameters (other checkers are better to detect these problems)
# -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
# -altera-struct-pack-align => Rationale: Not applicable (Altera is for openCL)
# -readability-function-cognitive-complexity => Warning is too strict, manual review code review is preferred
# -concurrency-mt-unsafe => Reports a false warning for strerror in main (not useful for CharLS)
# -llvm-namespace-comment => complains about namespace issues in system header files
# -hicpp-named-parameter => complains about issues in system header files
# -altera-unroll-loops => Does not apply (is for openCL)
# -altera-id-dependent-backward-branch => Does not apply (is for openCL)
# -bugprone-easily-swappable-parameters => To many do not fix warnings
---
Checks: '*,
-fuchsia-*,
-google-*,
-android-*,
-llvmlibc-*,
-llvm-header-guard,
-llvm-namespace-comment,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,
-hicpp-named-parameter,
-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-global-constructors,
-clang-diagnostic-exit-time-destructors,
-clang-diagnostic-pragma-once-outside-header,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-command-line-argument,
-clang-diagnostic-declaration-after-statement,
-clang-diagnostic-unsafe-buffer-usage,
-clang-analyzer-core.NonNullParamChecker,
-misc-non-private-member-variables-in-classes,
-misc-include-cleaner,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-readability-named-parameter,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-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-union-access,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-init-variables,
-cert-msc32-c,
-cert-msc51-cpp,
-cert-err58-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-altera-struct-pack-align,
-altera-unroll-loops,
-altera-id-dependent-backward-branch,
-readability-function-cognitive-complexity,
-bugprone-easily-swappable-parameters,
-concurrency-mt-unsafe'
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'