-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Description
Take your project DirectXTK as an example, in which you have set these conventions:
PascalCase for class names, methods, functions, and enums.
camelCase for class member variables, struct members
UPPERCASE for preprocessor defines (and nameless enums)
To enforce these naming conventions, you can add readability-* to the checks as shown below:
Checks: >
-*,
readability-*
Then add some of these check options:
CheckOptions:
readability-identifier-naming.ClassCase: 'CamelCase'
readability-identifier-naming.ClassMethodCase: 'CamelCase'
readability-identifier-naming.FunctionCase: 'CamelCase'
readability-identifier-naming.EnumCase: 'CamelCase'
readability-identifier-naming.ClassMemberCase: 'camelBack'
readability-identifier-naming.MemberCase: 'camelBack'
readability-identifier-naming.MacroDefinitionCase: 'UPPER_CASE'
readability-identifier-naming.EnumConstantCase: 'UPPER_CASE'
Microsoft Visual Studio supports Clang-Tidy and Clang-Format out of the box.
P.S.: while EditorConfig is fine, I think you can enforce more specific code-style conventions, such as east const and west const with Clang-Format.
Using Clang-Tidy (and perhaps also Clang-Format) could help maintain greater code consistency.
Reference:
Metadata
Metadata
Assignees
Labels
No labels