1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements.  See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership.  The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License.  You may obtain a copy of the License at
8#
9#   http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied.  See the License for the
15# specific language governing permissions and limitations
16# under the License.
17
18# The checks defined here will be run and will display by default as warnings.
19Checks: >
20    -*, cppcoreguidelines-c-copy-assignment-signature,
21    cppcoreguidelines-interfaces-global-init, cppcoreguidelines-no-malloc,
22    cppcoreguidelines-pro-bounds-constant-array-index, cppcoreguidelines-pro-type-const-cast,
23    cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-type-member-init,
24    cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-pro-type-union-access,
25    cppcoreguidelines-pro-type-vararg, cppcoreguidelines-slicing,
26    cppcoreguidelines-special-member-functions, clang-analyzer-security.FloatLoopCounter,
27    clang-analyzer-security.insecureAPI.*, clang-analyzer-core.CallAndMessage,
28    clang-analyzer-core.DivideZero, clang-analyzer-core.DynamicTypePropagation,
29    clang-analyzer-core.NonNullParamChecker, clang-analyzer-core.NullDereference,
30    clang-analyzer-core.StackAddressEscape, clang-analyzer-core.UndefinedBinaryOperatorResult,
31    clang-analyzer-core.VLASize, clang-analyzer-core.builtin.BuiltinFunctions,
32    clang-analyzer-core.builtin.NoReturnFunctions, clang-analyzer-core.uninitialized.ArraySubscript,
33    clang-analyzer-core.uninitialized.Assign, clang-analyzer-core.uninitialized.Branch,
34    clang-analyzer-core.uninitialized.CapturedBlockVariable,
35    clang-analyzer-core.uninitialized.UndefReturn, clang-analyzer-cplusplus.NewDelete,
36    clang-analyzer-cplusplus.NewDeleteLeaks, clang-analyzer-cplusplus.SelfAssignment,
37    clang-analyzer-deadcode.DeadStores, modernize-avoid-bind, modernize-deprecated-headers,
38    modernize-loop-convert, modernize-make-shared, modernize-pass-by-value,
39    modernize-raw-string-literal, modernize-redundant-void-arg, modernize-replace-auto-ptr,
40    modernize-replace-random-shuffle, modernize-return-braced-init-list, modernize-shrink-to-fit,
41    modernize-unary-static-assert, modernize-use-bool-literals, modernize-use-default-member-init,
42    modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete,
43    modernize-use-noexcept, modernize-use-nullptr, modernize-use-override,
44    modernize-use-transparent-functors, modernize-use-using, performance-*
45
46# cppcoreguidelines checks not enabled:
47# cppcoreguidelines-pro-bounds-pointer-arithmetic
48# cppcoreguidelines-pro-bounds-array-to-pointer-decay
49# cppcoreguidelines-pro-type-reinterpret-cast
50
51# modernize checks not enabled:
52# modernize-use-auto
53# modernize-make-unique (C++14 and newer only)
54
55# In order to trigger an error, you must have a rule defined both in checks and in this section.
56WarningsAsErrors: >
57    cppcoreguidelines-no-malloc, modernize-use-nullptr, performance-unnecessary-copy-initialization,
58    modernize-use-emplace, performance-move-const-arg
59
60# Todo: define a better regex match that includes most project headers, but excludes third party
61# code.
62HeaderFilterRegex: '^src/.*'
63