-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
97 lines (95 loc) · 6.11 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
# 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++14
# -clang-diagnostic-c++98-c++11-compat => Rationale: CharLS targets C++14
# -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-unused-const-variable => Rationale: false warnings for constexpr in .h files
# -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
# -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
# -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-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)
---
Checks: '*,
-fuchsia-*,
-google-*,
-android-*,
-llvmlibc-*,
-llvm-header-guard,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,
-clang-diagnostic-c++98-compat*,
-clang-diagnostic-c++98-c++11-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-unused-const-variable,
-clang-analyzer-core.NonNullParamChecker,
-misc-non-private-member-variables-in-classes,
-modernize-use-trailing-return-type,
-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-init-variables,
-cert-msc32-c,
-cert-msc51-cpp,
-cert-err58-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-altera-struct-pack-align,
-readability-function-cognitive-complexity,
-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'