From 70ce0097bd9d6cf8dc649217849b9db6f6fc2412 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 8 Jun 2026 16:55:05 +0800 Subject: [repo] Add clang-format and clang-tidy configuration --- .clang-format | 2 ++ .clang-format-ignore | 4 ++++ .clang-tidy | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-format-ignore create mode 100644 .clang-tidy diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..5d323cc --- /dev/null +++ b/.clang-format @@ -0,0 +1,2 @@ +BasedOnStyle: Google +LineEnding: LF diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 0000000..d495386 --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1,4 @@ +# Do not attempt to format .td files; we have too many formatting needs across +# the various files to allow automatic formatting. +**/*.td +rcc-legacy/ \ No newline at end of file diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..856ac61 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,43 @@ +HeaderFilterRegex: '' +Checks: > + -*, + clang-diagnostic-*, + llvm-*, + misc-*, + -misc-const-correctness, + -misc-include-cleaner, + -misc-no-recursion, + -misc-non-private-member-variables-in-classes, + -misc-unused-parameters, + -misc-use-anonymous-namespace, + readability-identifier-naming + +CheckOptions: + # Type + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.UnionCase, value: CamelCase } + - { key: readability-identifier-naming.EnumCase, value: CamelCase } + - { key: readability-identifier-naming.TypeAliasCase, value: CamelCase } + - { key: readability-identifier-naming.TypedefCase, value: CamelCase } + - { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase } + # Function + - { key: readability-identifier-naming.FunctionCase, value: camelBack } + - { key: readability-identifier-naming.MethodCase, value: camelBack } + # Variable + - { key: readability-identifier-naming.VariableCase, value: lower_case } + - { key: readability-identifier-naming.ParameterCase, value: lower_case } + - { key: readability-identifier-naming.MemberCase, value: lower_case } + - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } + - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } + # Constant + - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase } + - { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase } + - { key: readability-identifier-naming.ClassConstantCase, value: CamelCase } + - { key: readability-identifier-naming.EnumConstantCase, value: CamelCase } + - { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE } + # Other + - { key: readability-identifier-naming.IgnoreMainLikeFunctions, value: 1 } + - { key: readability-redundant-member-init.IgnoreBaseInCopyConstructors, value: 1 } + - { key: modernize-use-default-member-init.UseAssignment, value: 1 } -- cgit v1.2.3