|
| 1 | +# SPDX-License-Identifier: MIT |
| 2 | +# clang-tidy configuration for arbiter engine C sources. |
| 3 | +# |
| 4 | +# Run: clang-tidy -p build lib/*.c -- -I include |
| 5 | +# |
| 6 | +# Checks target safety-critical embedded C patterns: |
| 7 | +# bugprone-* — common bug patterns (use-after-move, narrowing, etc.) |
| 8 | +# cert-* — CERT C Coding Standard rules |
| 9 | +# clang-analyzer-* — Clang Static Analyzer checks |
| 10 | +# misc-* — miscellaneous (unused parameters, static asserts, etc.) |
| 11 | +# performance-* — unnecessary copies, moves, etc. |
| 12 | +# readability-identifier-naming — enforce Zephyr-style naming conventions |
| 13 | + |
| 14 | +Checks: > |
| 15 | + -*, |
| 16 | + bugprone-*, |
| 17 | + cert-*, |
| 18 | + clang-analyzer-*, |
| 19 | + misc-*, |
| 20 | + performance-*, |
| 21 | + readability-identifier-naming, |
| 22 | + -bugprone-easily-swappable-parameters, |
| 23 | + -bugprone-reserved-identifier, |
| 24 | + -cert-dcl37-c, |
| 25 | + -cert-dcl51-cpp, |
| 26 | + -misc-include-cleaner, |
| 27 | + -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling |
| 28 | +
|
| 29 | +WarningsAsErrors: '*' |
| 30 | + |
| 31 | +CheckOptions: |
| 32 | + # Struct/enum types: UPPER_SNAKE for ARBITER_* types |
| 33 | + - key: readability-identifier-naming.TypedefCase |
| 34 | + value: UPPER_CASE |
| 35 | + # Macros: UPPER_SNAKE |
| 36 | + - key: readability-identifier-naming.MacroDefinitionCase |
| 37 | + value: UPPER_CASE |
| 38 | + # Functions: mixed (ARBITER_* public API, snake_case internal) |
| 39 | + - key: readability-identifier-naming.FunctionCase |
| 40 | + value: aNy_CasE |
| 41 | + # Local variables: snake_case |
| 42 | + - key: readability-identifier-naming.LocalVariableCase |
| 43 | + value: lower_case |
| 44 | + # Parameters: snake_case |
| 45 | + - key: readability-identifier-naming.ParameterCase |
| 46 | + value: lower_case |
| 47 | + # Global constants: UPPER_CASE |
| 48 | + - key: readability-identifier-naming.GlobalConstantCase |
| 49 | + value: UPPER_CASE |
| 50 | + # Enum constants: UPPER_CASE |
| 51 | + - key: readability-identifier-naming.EnumConstantCase |
| 52 | + value: UPPER_CASE |
0 commit comments