Skip to content

Commit ff1db3e

Browse files
committed
Add clang-tidy checks for project naming conventions
1 parent d2f270e commit ff1db3e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Checks: >
1616
1717
1818
FormatStyle: 'file'
19+
# WarningsAsErrors: 'readability-identifier-naming'
1920
CheckOptions:
2021
# allow for
2122
# if (condition)
@@ -30,3 +31,38 @@ CheckOptions:
3031
value: 'i'
3132
- key: google-runtime-int.TypeSuffix
3233
value: ''
34+
# Naming/casing conventions
35+
- key: readability-identifier-naming.MacroDefinitionCase
36+
value: UPPER_CASE
37+
- key: readability-identifier-naming.TypedefSuffix
38+
value: _t
39+
# I haven't found a way to enforce enum members containing a prefix of the
40+
# enum name without a custom clang-tidy plugin
41+
- key: readability-identifier-naming.EnumCase
42+
value: UPPER_CASE
43+
- key: readability-identifier-naming.EnumConstantCase
44+
value: UPPER_CASE
45+
- key: readability-identifier-naming.GlobalVariablePrefix
46+
value: g_
47+
- key: readability-identifier-naming.VariableCase
48+
value: lower_case
49+
- key: readability-identifier-naming.GlobalVariableCase
50+
value: lower_case
51+
# - key: readability-identifier-naming.ConstantCase
52+
# value: UPPER_CASE
53+
- key: readability-identifier-naming.FunctionCase
54+
value: lower_case
55+
- key: readability-identifier-naming.TypedefCase
56+
value: lower_case
57+
- key: readability-identifier-naming.StructCase
58+
value: lower_case
59+
- key: readability-identifier-naming.UnionCase
60+
value: lower_case
61+
- key: readability-identifier-naming.EnumCase
62+
value: lower_case
63+
- key: readability-identifier-naming.EnumConstantCase
64+
value: UPPER_CASE
65+
- key: readability-identifier-naming.MacroDefinitionCase
66+
value: UPPER_CASE
67+
- key: readability-identifier-naming.FileCase
68+
value: lower_case

0 commit comments

Comments
 (0)