|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +# Layout is clang-format's job (see .clang-format), so clang-tidy does no |
| 6 | +# formatting of its own (FormatStyle: none below). Each enabled check is meant |
| 7 | +# to be adoptable on its own, so findings can be fixed one check at a time. |
| 8 | +# |
| 9 | +# Checks are opt-in (-*) by group, minus the ones below. They cannot be |
| 10 | +# commented inline because Checks is a single YAML string. |
| 11 | +# |
| 12 | +# Disabled because they conflict with the C-style CUDA driver API idioms: |
| 13 | +# bugprone-easily-swappable-parameters: wrappers of driver calls take many |
| 14 | +# adjacent parameters of the same type; the signatures mirror the API. |
| 15 | +# bugprone-assignment-in-if-condition: `if (CUDA_SUCCESS != (err = CALL(...)))` |
| 16 | +# is the standard error-handling pattern here. |
| 17 | +# performance-no-int-to-ptr: opaque handles and file descriptors are |
| 18 | +# converted to pointers with reinterpret_cast on purpose. |
| 19 | +# modernize-avoid-c-arrays: arrays are passed to and filled by C APIs. |
| 20 | +# modernize-return-braced-init-list: `return {};` vs. an explicit type is |
| 21 | +# left to the author; it adds noise for the driver-API result structs. |
| 22 | +# |
| 23 | +# Disabled because they do not match the codebase style: |
| 24 | +# performance-enum-size: enum underlying types are left as they are. |
| 25 | +# misc-const-correctness: const on every local is not the convention here. |
| 26 | +# readability-function-cognitive-complexity: a metric threshold, not a defect; |
| 27 | +# it flags only ensure_fn_table, which is flat error handling. |
| 28 | +# readability-identifier-length: short names such as the handle parameter `h` |
| 29 | +# are used throughout. |
| 30 | +# readability-implicit-bool-conversion: `if (ptr)` and `if (handle)` are the |
| 31 | +# idiom for pointers and handles. |
| 32 | +# misc-include-cleaner: too noisy with the CUDA and CPython umbrella headers. |
| 33 | +# misc-no-recursion: recursion is used deliberately. |
| 34 | +# misc-use-anonymous-namespace: file-local functions use `static`. |
| 35 | +# modernize-use-trailing-return-type: the code uses `Type\nname()` layout. |
| 36 | +Checks: > |
| 37 | + -*, |
| 38 | + bugprone-*, |
| 39 | + -bugprone-easily-swappable-parameters, |
| 40 | + -bugprone-assignment-in-if-condition, |
| 41 | + clang-analyzer-*, |
| 42 | + misc-*, |
| 43 | + -misc-include-cleaner, |
| 44 | + -misc-const-correctness, |
| 45 | + -misc-no-recursion, |
| 46 | + -misc-use-anonymous-namespace, |
| 47 | + modernize-*, |
| 48 | + -modernize-use-trailing-return-type, |
| 49 | + -modernize-avoid-c-arrays, |
| 50 | + -modernize-return-braced-init-list, |
| 51 | + performance-*, |
| 52 | + -performance-enum-size, |
| 53 | + -performance-no-int-to-ptr, |
| 54 | + readability-*, |
| 55 | + -readability-function-cognitive-complexity, |
| 56 | + -readability-identifier-length, |
| 57 | + -readability-implicit-bool-conversion |
| 58 | +FormatStyle: none |
| 59 | +CheckOptions: |
| 60 | + # Records whose members are all public (the *Box and guard structs) are plain |
| 61 | + # data holders; only a mix of public and private members is flagged. |
| 62 | + misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true |
| 63 | +WarningsAsErrors: '*' |
| 64 | +# Only report diagnostics for our own headers, not CUDA/CPython/libstdc++. |
| 65 | +HeaderFilterRegex: 'cuda_core/cuda/core/_(cpp|include)/' |
| 66 | +ExcludeHeaderFilterRegex: 'cuda_core/cuda/core/_include/(dlpack|aoti_shim)\.h' |
0 commit comments