diff --git a/test/.clang-format b/test/.clang-format new file mode 100644 index 0000000..9bfc990 --- /dev/null +++ b/test/.clang-format @@ -0,0 +1,7 @@ +--- +Language: Cpp +BasedOnStyle: Google +BreakAfterAttributes: Leave +CommentPragmas: '^ (IWYU pragma:|NOLINT(BEGIN|END|NEXTLINE)?(\(.+\))?:? )' +DerivePointerAlignment: false +InsertNewlineAtEOF: true diff --git a/test/.clang-tidy b/test/.clang-tidy new file mode 100644 index 0000000..7e66685 --- /dev/null +++ b/test/.clang-tidy @@ -0,0 +1,87 @@ +--- +Checks: ' + bugprone-*, + -bugprone-easily-swappable-parameters, + clang-analyzer-*, + clang-diagnostic-*, + cppcoreguidelines-*, + google-*, + -google-*googletest*, + hicpp-avoid-goto, + hicpp-exception-baseclass, + misc-header-include-cycle, + misc-static-assert, + misc-unused-alias-decls, + misc-unused-using-decls, + modernize-*, + performance-*, + readability-*, + -readability-qualified-auto, + -readability-static-accessed-through-instance' +# AnalyzeTemporaryDtors: false +FormatStyle: file +HeaderFilterRegex: '.*' +CheckOptions: + - key: cppcoreguidelines-avoid-do-while.IgnoreMacros + value: true + - key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes + value: 'size_t;ptrdiff_t;size_type;difference_type' + - key: readability-function-cognitive-complexity.IgnoreMacros + value: true + - key: readability-identifier-length.MinimumVariableNameLength + value: 2 + - key: readability-identifier-length.MinimumParameterNameLength + value: 2 +# --- Google's naming convention BEGIN --- +# modified part is marked as comment + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.ClassMemberCase + value: lower_case + - key: readability-identifier-naming.ConstexprVariableCase + value: CamelCase + - key: readability-identifier-naming.ConstexprVariablePrefix + value: k + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantPrefix + value: k + - key: readability-identifier-naming.FunctionCase + # value: CamelCase + value: lower_case + - key: readability-identifier-naming.GlobalConstantCase + value: CamelCase + - key: readability-identifier-naming.GlobalConstantPrefix + value: k + - key: readability-identifier-naming.StaticConstantCase + value: CamelCase + - key: readability-identifier-naming.StaticConstantPrefix + value: k + - key: readability-identifier-naming.StaticVariableCase + value: lower_case + - key: readability-identifier-naming.MacroDefinitionCase + value: UPPER_CASE + - key: readability-identifier-naming.MacroDefinitionIgnoredRegexp + value: '^[A-Z]+(_[A-Z]+)*_$' + - key: readability-identifier-naming.MemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberSuffix + value: _ + - key: readability-identifier-naming.PublicMemberSuffix + value: '' + - key: readability-identifier-naming.NamespaceCase + value: lower_case + - key: readability-identifier-naming.ParameterCase + value: lower_case + - key: readability-identifier-naming.TypeAliasCase + value: CamelCase + - key: readability-identifier-naming.TypedefCase + value: CamelCase + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.IgnoreMainLikeFunctions + value: 1 +# --- Google's naming convention END --- +... diff --git a/test/a.cpp b/test/a.cpp new file mode 100644 index 0000000..44c30f3 --- /dev/null +++ b/test/a.cpp @@ -0,0 +1,4 @@ +class AA { + public: + public: +}; diff --git a/test/b.cpp b/test/b.cpp new file mode 100644 index 0000000..cae2ba1 --- /dev/null +++ b/test/b.cpp @@ -0,0 +1,2 @@ +int +main() { int a; int b; c=1 } diff --git a/test/c.cpp b/test/c.cpp new file mode 100644 index 0000000..e69de29