我想找出可以使用-fix选项运行哪些整洁的检查,即自动生成固定代码。 我知道所有的modern- *检查都可以做到这一点,其他一些检查也可以做到这一点(例如google-readability-casting),但我在哪里都找不到完整的列表。 某处有清单吗?还是一种方法,除了读取每张支票的来源以外,还能找到其他方法?
答案 0 :(得分:1)
grep --include=\*.cpp -rc './' -e "FixItHint"|grep -v ':0$' > FixItChecks.txt
我在clang-tidy源目录中运行了这个grep命令。它计算所有.cpp文件中“ FixItHint”字符串的出现次数,并过滤掉出现次数为零的文件。
clang::FixItHint
是一个类(根据文档):
用一些应插入,删除或替换的代码来注释诊断程序,以解决该问题。
我承认获取列表的方法有些粗糙,但是我检查了多个文件,结果似乎是正确的。
带有修复的检查的清理列表和排序列表:
abseil/StringFindStartswithCheck
android/CloexecCheck
boost/UseToStringCheck
bugprone/ArgumentCommentCheck
bugprone/BoolPointerImplicitConversionCheck
bugprone/CopyConstructorInitCheck
bugprone/InaccurateEraseCheck
bugprone/MacroParenthesesCheck
bugprone/MisplacedOperatorInStrlenInAllocCheck
bugprone/MoveForwardingReferenceCheck
bugprone/ParentVirtualCallCheck
bugprone/StringIntegerAssignmentCheck
bugprone/SuspiciousMemsetUsageCheck
bugprone/SuspiciousSemicolonCheck
bugprone/SuspiciousStringCompareCheck
bugprone/UnusedRaiiCheck
bugprone/VirtualNearMissCheck
cert/PostfixOperatorCheck
cppcoreguidelines/ProBoundsConstantArrayIndexCheck
cppcoreguidelines/ProTypeCstyleCastCheck
cppcoreguidelines/ProTypeMemberInitCheck
cppcoreguidelines/ProTypeStaticCastDowncastCheck
fuchsia/DefaultArgumentsCheck
fuchsia/RestrictSystemIncludesCheck
google/AvoidCStyleCastsCheck
google/ExplicitConstructorCheck
google/ExplicitMakePairCheck
google/GlobalVariableDeclarationCheck
google/TodoCommentCheck
llvm/IncludeOrderCheck
llvm/TwineLocalCheck
misc/DefinitionsInHeadersCheck
misc/RedundantExpressionCheck
misc/StaticAssertCheck
misc/UniqueptrResetReleaseCheck
misc/UnusedAliasDeclsCheck
misc/UnusedParametersCheck
misc/UnusedUsingDeclsCheck
modernize/AvoidBindCheck
modernize/DeprecatedHeadersCheck
modernize/LoopConvertCheck
modernize/MakeSmartPtrCheck
modernize/PassByValueCheck
modernize/RawStringLiteralCheck
modernize/RedundantVoidArgCheck
modernize/ReplaceAutoPtrCheck
modernize/ReplaceRandomShuffleCheck
modernize/ReturnBracedInitListCheck
modernize/ShrinkToFitCheck
modernize/UnaryStaticAssertCheck
modernize/UseAutoCheck
modernize/UseBoolLiteralsCheck
modernize/UseDefaultMemberInitCheck
modernize/UseEmplaceCheck
modernize/UseEqualsDefaultCheck
modernize/UseEqualsDeleteCheck
modernize/UseNoexceptCheck
modernize/UseNullptrCheck
modernize/UseOverrideCheck
modernize/UseTransparentFunctorsCheck
modernize/UseUncaughtExceptionsCheck
modernize/UseUsingCheck
objc/PropertyDeclarationCheck
performance/FasterStringFindCheck
performance/ForRangeCopyCheck
performance/InefficientAlgorithmCheck
performance/InefficientVectorOperationCheck
performance/MoveConstArgCheck
performance/TypePromotionInMathFnCheck
performance/UnnecessaryCopyInitialization
performance/UnnecessaryValueParamCheck
readability/AvoidConstParamsInDecls
readability/BracesAroundStatementsCheck
readability/ContainerSizeEmptyCheck
readability/DeleteNullPointerCheck
readability/IdentifierNamingCheck
readability/ImplicitBoolConversionCheck
readability/InconsistentDeclarationParameterNameCheck
readability/MisplacedArrayIndexCheck
readability/NamedParameterCheck
readability/NamespaceCommentCheck
readability/NonConstParameterCheck
readability/RedundantControlFlowCheck
readability/RedundantDeclarationCheck
readability/RedundantFunctionPtrDereferenceCheck
readability/RedundantMemberInitCheck
readability/RedundantSmartptrGetCheck
readability/RedundantStringCStrCheck
readability/RedundantStringInitCheck
readability/SimplifyBooleanExprCheck
readability/SimplifySubscriptExprCheck
readability/StaticAccessedThroughInstanceCheck
readability/StaticDefinitionInAnonymousNamespaceCheck
readability/StringCompareCheck
readability/UniqueptrDeleteReleaseCheck