Skip to content

Commit

Permalink
Refactor clang-tidy file for tests (#174)
Browse files Browse the repository at this point in the history
Refactor clang-tidy file for tests
  • Loading branch information
PatrickKa authored Dec 9, 2023
2 parents 7a0d43a + 2e6197b commit edea19d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 178 deletions.
180 changes: 4 additions & 176 deletions Tests/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,176 +1,4 @@
---
Checks: "*,\
-*magic-numbers*,\
-abseil-*,\
-altera-id-dependent-backward-branch,\
-altera-kernel-name-restriction,\
-altera-single-work-item-barrier,\
-altera-struct-pack-align,\
-altera-unroll-loops,\
-android-*,\
-cppcoreguidelines-avoid-non-const-global-variables,\
-cppcoreguidelines-pro-bounds-constant-array-index,\
-cppcoreguidelines-pro-type-vararg,\
-darwin-*,\
-fuchsia-*,\
fuchsia-multiple-inheritance,\
-google-objc-*,\
-google-readability-todo,\
-google-readability-namespace-comments,\
-hicpp-vararg,\
-linuxkernel-must-use-errs,\
-llvm-header-guard,\
-llvm-namespace-comment,\
-llvmlibc-*,\
-misc-non-private-member-variables-in-classes,\
-mpi-*,\
-openmp-*,\
-readability-function-cognitive-complexity"
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: 'bugprone-argument-comment.StrictMode'
value: 'true'
# Prefer using enum classes with 2 values for parameters instead of bools
- key: 'bugprone-argument-comment.CommentBoolLiterals'
value: 'true'
- key: 'bugprone-misplaced-widening-cast.CheckImplicitCasts'
value: 'true'
- key: 'bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression'
value: 'true'
- key: 'bugprone-suspicious-string-compare.WarnOnLogicalNotComparison'
value: 'true'
- key: 'readability-simplify-boolean-expr.ChainedConditionalReturn'
value: 'true'
- key: 'readability-simplify-boolean-expr.ChainedConditionalAssignment'
value: 'true'
- key: 'readability-uniqueptr-delete-release.PreferResetCall'
value: 'true'
- key: 'cppcoreguidelines-init-variables.MathHeader'
value: '<cmath>'
- key: 'cppcoreguidelines-narrowing-conversions.PedanticMode'
value: 'true'
- key: 'readability-else-after-return.WarnOnUnfixable'
value: 'true'
- key: 'readability-else-after-return.WarnOnConditionVariables'
value: 'true'
- key: 'readability-identifier-naming.IgnoreMainLikeFunctions'
value: 'true'
- key: 'readability-inconsistent-declaration-parameter-name.Strict'
value: 'true'
- key: 'readability-qualified-auto.AddConstToQualified'
value: 'true'
- key: 'readability-redundant-access-specifiers.CheckFirstDeclaration'
value: 'true'
# These seem to be the most common identifier styles
- key: 'readability-identifier-naming.AbstractClassCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ClassCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ClassConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ClassMemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ClassMethodCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ConstantMemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ConstantParameterCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ConstantPointerParameterCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ConstexprFunctionCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ConstexprMethodCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ConstexprVariableCase'
value: 'camelBack'
- key: 'readability-identifier-naming.EnumCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.EnumConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.FunctionCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.GlobalConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.GlobalConstantPointerCase'
value: 'camelBack'
- key: 'readability-identifier-naming.GlobalFunctionCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.GlobalPointerCase'
value: 'camelBack'
- key: 'readability-identifier-naming.GlobalVariableCase'
value: 'camelBack'
# Namespaces should actually be all lower case without underscores
- key: 'readability-identifier-naming.InlineNamespaceCase'
value: 'camelBack'
- key: 'readability-identifier-naming.LocalConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.LocalConstantPointerCase'
value: 'camelBack'
- key: 'readability-identifier-naming.LocalPointerCase'
value: 'camelBack'
- key: 'readability-identifier-naming.LocalVariableCase'
value: 'camelBack'
- key: 'readability-identifier-naming.MacroDefinitionCase'
value: 'UPPER_CASE'
- key: 'readability-identifier-naming.MemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.MethodCase'
value: 'CamelCase'
# Namespaces should actually be all lower case without underscores
- key: 'readability-identifier-naming.NamespaceCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ParameterCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ParameterPackCase'
value: 'camelBack'
- key: 'readability-identifier-naming.PointerParameterCase'
value: 'camelBack'
- key: 'readability-identifier-naming.PrivateMemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.PrivateMemberSuffix'
value: '_'
- key: 'readability-identifier-naming.PrivateMethodCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ProtectedMemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.ProtectedMemberSuffix'
value: '_'
- key: 'readability-identifier-naming.ProtectedMethodCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.PublicMemberCase'
value: 'camelBack'
- key: 'readability-identifier-naming.PublicMethodCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ScopedEnumConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.StaticConstantCase'
value: 'camelBack'
- key: 'readability-identifier-naming.StaticVariableCase'
value: 'camelBack'
- key: 'readability-identifier-naming.StructCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.TemplateParameterCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.TemplateTemplateParameterCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.TypeAliasCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.TypedefCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.TypeTemplateParameterCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.UnionCase'
value: 'CamelCase'
- key: 'readability-identifier-naming.ValueTemplateParameterCase'
value: 'camelBack'
- key: 'readability-identifier-naming.VariableCase'
value: 'camelBack'
- key: 'readability-identifier-naming.VirtualMethodCase'
value: 'CamelCase'
...
Checks: "-readability-identifier-length, \
-*magic-numbers*"
InheritParentConfig: true

4 changes: 2 additions & 2 deletions Tests/UnitTests/Serial.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ TEST_CASE("(De-)Serialize user-defined types (default endian)")
REQUIRE(int(sBuffer[4]) == 0x34);
REQUIRE(int(sBuffer[5]) == 0x12);

auto s = Deserialize<S>(sBuffer); // NOLINT(readability-identifier-length)
auto s = Deserialize<S>(sBuffer);
REQUIRE(s.u16 == 0xABCD);
REQUIRE(s.i32 == 0x12345678);
}
Expand All @@ -308,7 +308,7 @@ TEST_CASE("(De-)Serialize user-defined types (big endian)")
REQUIRE(int(sBuffer[4]) == 0x56);
REQUIRE(int(sBuffer[5]) == 0x78);

auto s = Deserialize<std::endian::big, S>(sBuffer); // NOLINT(readability-identifier-length)
auto s = Deserialize<std::endian::big, S>(sBuffer);
REQUIRE(s.u16 == 0xABCD);
REQUIRE(s.i32 == 0x12345678);
}

0 comments on commit edea19d

Please sign in to comment.