• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2025 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15FormatStyle:         file
16InheritParentConfig: true
17
18# Note: For tests, we are actually turning off certain checks enabled for the
19# non-test code in the parent .clang-tidy file.
20Checks:
21  - -cppcoreguidelines-avoid-magic-numbers  # Allow tests to use magic numbers.
22  - -cppcoreguidelines-avoid-goto  # Google Test macros use goto.
23  - -cppcoreguidelines-avoid-non-const-global-variables  # Google Test macros define global variables.
24  - -cppcoreguidelines-macro-usage  # Google Benchmark defines function-like macros.
25  - -cppcoreguidelines-owning-memory  # Google Test macros use operator new directly.
26  - -google-runtime-int  # Tests might intentionally use the base "short"/"long" types and not want to use "int16"/"int64".
27  - -misc-use-anonymous-namespace  # Google Test macros declare some static global variables to not export them.
28  - -modernize-use-trailing-return-type  # Google Test macros use non-trailing return types.
29  - -performance-move-const-arg  # Tests might std::move() a trivially copyable value as part of testing that moving works.
30  - -readability-function-cognitive-complexity  # Assertions turn into extra branches, increasing apparent complexity.
31  - -readability-magic-numbers  # Allow tests to use magic numbers
32
33