-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-tidy
More file actions
120 lines (110 loc) · 4 KB
/
.clang-tidy
File metadata and controls
120 lines (110 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
# Clang-Tidy configuration for Polang
#
# Run with:
# clang-tidy -p build <source-file>
#
# Or check all files:
# clang-tidy -p build parser/src/*.cpp compiler/src/*.cpp repl/src/*.cpp mlir/lib/*/*.cpp
Checks: >
-*,
bugprone-*,
performance-*,
modernize-*,
readability-*,
-bugprone-easily-swappable-parameters,
-modernize-use-trailing-return-type,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-convert-member-functions-to-static,
-performance-enum-size
# Only check project headers, not system/LLVM/MLIR headers or generated files
# Excludes build/ directory by requiring path to start with the component name
HeaderFilterRegex: '^.*/polang/(parser|compiler|repl|mlir)/(include|lib)/.*\\.hpp?$'
# Don't treat warnings as errors (use -warnings-as-errors= to override)
WarningsAsErrors: ''
CheckOptions:
# Braces around statements
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
# Implicit bool conversion settings
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: false
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: false
# Modernize settings
- key: modernize-use-override.IgnoreDestructors
value: false
- key: modernize-use-override.IgnoreTemplateInstantiations
value: false
# Performance settings
- key: performance-unnecessary-value-param.IncludeStyle
value: google
# Avoid false positives for MLIR patterns
- key: bugprone-unused-return-value.CheckedFunctions
value: ''
# Naming conventions - LLVM style (lowerCamelCase for functions/variables)
# Types: CamelCase
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassIgnoredRegexp
value: '^(raw_|llvm_|mlir_).*'
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasIgnoredRegexp
value: '^YY_.*'
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.TypedefIgnoredRegexp
value: '^YY_.*'
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
# Functions/Methods: lowerCamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: '^(polang_|yy_).*'
- key: readability-identifier-naming.MethodCase
value: camelBack
# Variables: lowerCamelCase
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
- key: readability-identifier-naming.LocalConstantCase
value: camelBack
# Members: lowerCamelCase
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.PublicMemberCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberCase
value: camelBack
- key: readability-identifier-naming.ProtectedMemberCase
value: camelBack
# Constants: UPPER_CASE for global/static, lowerCamelCase for local
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ConstexprVariableCase
value: UPPER_CASE
# Namespaces: lowercase
- key: readability-identifier-naming.NamespaceCase
value: lower_case
# Magic numbers - ignore common values
- key: readability-magic-numbers.IgnoredIntegerValues
value: '0;1;2;-1'
- key: readability-magic-numbers.IgnoredFloatingPointValues
value: '0.0;1.0;-1.0'
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: true
- key: readability-magic-numbers.IgnoreTypeAliases
value: true
...