|
| 1 | +# Tap House Rules — naming + mandatory-braces enforcement. Copy verbatim into |
| 2 | +# every *Tap repo. This is what actually checks m_ members, k_ constants, snake_case |
| 3 | +# types/functions, PascalCase template parameters, and braces around every |
| 4 | +# control-flow body — clang-format cannot (and its InsertBraces is not |
| 5 | +# semantically aware). Scope is intentionally limited to these for now; |
| 6 | +# correctness/modernize checks can be layered on later. |
| 7 | +# |
| 8 | +# NOTE: WarningsAsErrors is intentionally NOT set here so local runs only warn. |
| 9 | +# CI passes --warnings-as-errors=readability-* to make the gate blocking. |
| 10 | +Checks: > |
| 11 | + -*, |
| 12 | + readability-identifier-naming, |
| 13 | + readability-braces-around-statements |
| 14 | +# Analyze this project's own headers only (under include/); vendored third_party |
| 15 | +# and fetched deps live outside include/ and are excluded. Generated tables |
| 16 | +# (room_data.h, hrtf_data.h, tdesigns.h) live under include/ but carry |
| 17 | +# // NOLINTBEGIN(readability-identifier-naming) markers from their generators. |
| 18 | +# NOTE: clang-tidy uses llvm::Regex, which has NO negative lookahead — a |
| 19 | +# '^(?!...)' pattern silently matches nothing and disables the check. |
| 20 | +HeaderFilterRegex: '.*/(include|tests)/.*' |
| 21 | + |
| 22 | +# --- Linear-algebra notation carve-out -------------------------------------- |
| 23 | +# The DSP math deliberately uses capitalized matrix/vector symbols (Y = SH |
| 24 | +# matrix, D = decoder, R = rotation, ...). Permit a leading-capital symbol with |
| 25 | +# an optional short subscript and _snake suffixes (Y, Yd, R9, Y_virtual). This |
| 26 | +# Also matrix products (DtD, YtD). Still rejects camelCase (frameCount). |
| 27 | +# Applied below per category via <Category>IgnoredRegexp. |
| 28 | +CheckOptions: |
| 29 | + # --- Types: snake_case --- |
| 30 | + - key: readability-identifier-naming.ClassCase |
| 31 | + value: lower_case |
| 32 | + - key: readability-identifier-naming.StructCase |
| 33 | + value: lower_case |
| 34 | + - key: readability-identifier-naming.UnionCase |
| 35 | + value: lower_case |
| 36 | + - key: readability-identifier-naming.EnumCase |
| 37 | + value: lower_case |
| 38 | + - key: readability-identifier-naming.EnumConstantCase |
| 39 | + value: lower_case |
| 40 | + - key: readability-identifier-naming.ScopedEnumConstantCase |
| 41 | + value: lower_case |
| 42 | + - key: readability-identifier-naming.TypeAliasCase |
| 43 | + value: lower_case |
| 44 | + - key: readability-identifier-naming.TypedefCase |
| 45 | + value: lower_case |
| 46 | + - key: readability-identifier-naming.NamespaceCase |
| 47 | + value: lower_case |
| 48 | + |
| 49 | + # --- Concepts: snake_case (like the types they constrain, per P1754) --- |
| 50 | + - key: readability-identifier-naming.ConceptCase |
| 51 | + value: lower_case |
| 52 | + |
| 53 | + # --- Functions / methods: snake_case --- |
| 54 | + - key: readability-identifier-naming.FunctionCase |
| 55 | + value: lower_case |
| 56 | + - key: readability-identifier-naming.MethodCase |
| 57 | + value: lower_case |
| 58 | + |
| 59 | + # --- Variables / parameters / locals: snake_case, no prefix --- |
| 60 | + - key: readability-identifier-naming.VariableCase |
| 61 | + value: lower_case |
| 62 | + - key: readability-identifier-naming.ParameterCase |
| 63 | + value: lower_case |
| 64 | + - key: readability-identifier-naming.LocalVariableCase |
| 65 | + value: lower_case |
| 66 | + - key: readability-identifier-naming.LocalConstantCase |
| 67 | + value: lower_case |
| 68 | + # Math-notation carve-out (see header): capitalized matrix/vector symbols. |
| 69 | + - key: readability-identifier-naming.ParameterIgnoredRegexp |
| 70 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 71 | + - key: readability-identifier-naming.LocalVariableIgnoredRegexp |
| 72 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 73 | + - key: readability-identifier-naming.LocalConstantIgnoredRegexp |
| 74 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 75 | + - key: readability-identifier-naming.VariableIgnoredRegexp |
| 76 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 77 | + |
| 78 | + # --- Data members: private/protected get m_; public struct fields bare --- |
| 79 | + - key: readability-identifier-naming.PrivateMemberCase |
| 80 | + value: lower_case |
| 81 | + - key: readability-identifier-naming.PrivateMemberPrefix |
| 82 | + value: 'm_' |
| 83 | + - key: readability-identifier-naming.ProtectedMemberCase |
| 84 | + value: lower_case |
| 85 | + - key: readability-identifier-naming.ProtectedMemberPrefix |
| 86 | + value: 'm_' |
| 87 | + - key: readability-identifier-naming.PublicMemberCase |
| 88 | + value: lower_case |
| 89 | + # const (non-static) data members are still members -> keep the m_ marker |
| 90 | + - key: readability-identifier-naming.ConstantMemberCase |
| 91 | + value: lower_case |
| 92 | + - key: readability-identifier-naming.ConstantMemberPrefix |
| 93 | + value: 'm_' |
| 94 | + # Math-notation carve-out for capitalized matrix/vector member symbols. |
| 95 | + - key: readability-identifier-naming.PublicMemberIgnoredRegexp |
| 96 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 97 | + - key: readability-identifier-naming.PrivateMemberIgnoredRegexp |
| 98 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 99 | + - key: readability-identifier-naming.ProtectedMemberIgnoredRegexp |
| 100 | + value: '^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$' |
| 101 | + |
| 102 | + # --- Constants at namespace/class/static scope: k_ + snake_case --- |
| 103 | + # (constexpr/const LOCALS stay bare via LocalConstantCase above) |
| 104 | + - key: readability-identifier-naming.GlobalConstantCase |
| 105 | + value: lower_case |
| 106 | + - key: readability-identifier-naming.GlobalConstantPrefix |
| 107 | + value: 'k_' |
| 108 | + - key: readability-identifier-naming.ClassConstantCase |
| 109 | + value: lower_case |
| 110 | + - key: readability-identifier-naming.ClassConstantPrefix |
| 111 | + value: 'k_' |
| 112 | + - key: readability-identifier-naming.StaticConstantCase |
| 113 | + value: lower_case |
| 114 | + - key: readability-identifier-naming.StaticConstantPrefix |
| 115 | + value: 'k_' |
| 116 | + |
| 117 | + # --- Template parameters: PascalCase (the ONLY leading-capital names) --- |
| 118 | + # Applies to type AND non-type params: template <int Order>, not <int order>. |
| 119 | + - key: readability-identifier-naming.TemplateParameterCase |
| 120 | + value: CamelCase |
| 121 | + - key: readability-identifier-naming.TypeTemplateParameterCase |
| 122 | + value: CamelCase |
| 123 | + - key: readability-identifier-naming.ValueTemplateParameterCase |
| 124 | + value: CamelCase |
| 125 | + |
| 126 | + # --- Macros: ALL_CAPS --- |
| 127 | + - key: readability-identifier-naming.MacroDefinitionCase |
| 128 | + value: UPPER_CASE |
| 129 | + |
| 130 | + # --- Mandatory braces: brace every control-flow body, even one-liners --- |
| 131 | + - key: readability-braces-around-statements.ShortStatementLines |
| 132 | + value: '0' |
0 commit comments