Update clang tidy with new checks
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I95ad08f3d380bfb3231355df9e11fc6865595fca
diff --git a/.clang-tidy b/.clang-tidy
index 12b4a4a..b2299bf 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,6 @@
Checks: '
-*,
+boost-use-to-string,
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
@@ -11,6 +12,7 @@
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
+bugprone-implicit-widening-of-multiplication-result,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-infinite-loop,
@@ -21,12 +23,15 @@
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
+bugprone-move-forwarding-reference,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-not-null-terminated-result,
bugprone-parent-virtual-call,
bugprone-posix-return,
+bugprone-redundant-branch-condition,
bugprone-reserved-identifier,
+bugprone-signal-handler,
bugprone-signed-char-misuse,
bugprone-sizeof-container,
bugprone-sizeof-expression,
@@ -46,6 +51,7 @@
bugprone-too-small-loop-variable,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
+bugprone-unhandled-exception-at-new,
bugprone-unhandled-self-assignment,
bugprone-unused-raii,
bugprone-unused-return-value,
@@ -76,6 +82,11 @@
cert-oop11-cpp,
cert-oop54-cpp,
cert-oop57-cpp,
+cert-oop58-cpp,
+cert-pos44-c,
+cert-pos47-c,
+cert-sig30-c,
+cert-str34-c,
clang-analyzer-apiModeling.StdCLibraryFunctions,
clang-analyzer-apiModeling.TrustNonnull,
clang-analyzer-apiModeling.google.GTest,
@@ -187,8 +198,23 @@
clang-analyzer-webkit.RefCntblBaseVirtualDtor,
cppcoreguidelines-avoid-c-arrays,
cppcoreguidelines-avoid-goto,
+cppcoreguidelines-c-copy-assignment-signature,
+cppcoreguidelines-explicit-virtual-functions,
cppcoreguidelines-init-variables,
+cppcoreguidelines-interfaces-global-init,
+cppcoreguidelines-macro-usage,
+cppcoreguidelines-no-malloc,
+cppcoreguidelines-prefer-member-initializer,
+cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+cppcoreguidelines-pro-type-const-cast,
+cppcoreguidelines-pro-type-cstyle-cast,
+cppcoreguidelines-pro-type-member-init,
+cppcoreguidelines-pro-type-reinterpret-cast,
+cppcoreguidelines-pro-type-static-cast-downcast,
+cppcoreguidelines-pro-type-union-access,
cppcoreguidelines-pro-type-vararg,
+cppcoreguidelines-slicing,
+google-explicit-constructor,
misc-misplaced-const,
misc-redundant-expression,
misc-static-assert,
@@ -221,33 +247,55 @@
modernize-use-using,
performance-faster-string-find,
performance-for-range-copy,
-performance-for-range-copy,
performance-implicit-conversion-in-loop,
-performance-implicit-conversion-in-loop,
-performance-inefficient-algorithm,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
-performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
-performance-move-constructor-init,
performance-no-automatic-move,
-performance-no-automatic-move,
+performance-no-int-to-ptr,
performance-noexcept-move-constructor,
performance-trivially-destructible,
-performance-trivially-destructible,
performance-type-promotion-in-math-fn,
-performance-type-promotion-in-math-fn,
-performance-unnecessary-copy-initialization,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
+readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
+readability-container-size-empty,
+readability-convert-member-functions-to-static,
readability-delete-null-pointer,
readability-deleted-default,
readability-else-after-return,
-readability-identifier-naming'
+readability-function-size,
+readability-identifier-naming,
+readability-implicit-bool-conversion,
+readability-inconsistent-declaration-parameter-name,
+readability-isolate-declaration,
+readability-make-member-function-const,
+readability-misleading-indentation,
+readability-misplaced-array-index,
+readability-named-parameter,
+readability-non-const-parameter,
+readability-qualified-auto,
+readability-redundant-access-specifiers,
+readability-redundant-control-flow,
+readability-redundant-declaration,
+readability-redundant-function-ptr-dereference,
+readability-redundant-member-init,
+readability-redundant-preprocessor,
+readability-redundant-smartptr-get,
+readability-redundant-string-cstr,
+readability-redundant-string-init,
+readability-simplify-boolean-expr,
+readability-simplify-subscript-expr,
+readability-static-accessed-through-instance,
+readability-static-definition-in-anonymous-namespace,
+readability-string-compare,
+readability-suspicious-call-argument,
+readability-uniqueptr-delete-release,
+readability-uppercase-literal-suffix'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
@@ -260,3 +308,4 @@
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.StructIgnoredRegexp, value: ((peci_xfer_msg)|(peci_ping_msg)|(peci_get_dib_msg)|(peci_get_temp_msg)|(peci_rd_pkg_cfg_msg)|(peci_wr_pkg_cfg_msg)|(peci_rd_ia_msr_msg)|(peci_wr_ia_msr_msg)|(peci_rd_ia_msrex_msg)|(peci_rd_pci_cfg_msg)|(peci_wr_pci_cfg_msg)|(peci_rd_pci_cfg_local_msg)|(peci_wr_pci_cfg_local_msg)|(peci_rd_end_pt_cfg_msg)|(peci_wr_end_pt_cfg_msg)|(peci_crashdump_disc_msg)|(peci_crashdump_get_frame_msg)) }
- { key: bugprone-reserved-identifier.AllowedIdentifiers, value: __PECI_IOCTL_H }
+ - { key: cppcoreguidelines-macro-usage.AllowedRegexp, value: ((__PECI_IOCTL_H)|(PECI_BASE_ADDR)|(PECI_OFFSET_MAX)|(PECI_BUFFER_SIZE)|(PECI_DEV_CC_SUCCESS)|(PECI_DEV_CC_NEED_RETRY)|(PECI_DEV_CC_OUT_OF_RESOURCE)|(PECI_DEV_CC_UNAVAIL_RESOURCE)|(PECI_DEV_CC_INVALID_REQ)|(PECI_DEV_CC_MCA_ERROR)|(PECI_DEV_CC_CATASTROPHIC_MCA_ERROR)|(PECI_DEV_CC_FATAL_MCA_DETECTED)|(PECI_DEV_CC_PARITY_ERROR_ON_GPSB_OR_PMSB)|(PECI_DEV_CC_PARITY_ERROR_ON_GPSB_OR_PMSB_IERR)|(PECI_DEV_CC_PARITY_ERROR_ON_GPSB_OR_PMSB_MCA)|(PECI_DEV_CC_RETRY_CHECK_MASK)|(PECI_DEV_RETRY_INTERVAL_MIN_MSEC)|(PECI_DEV_RETRY_INTERVAL_MAX_MSEC)|(PECI_DEV_RETRY_BIT)|(PECI_GET_DIB_WR_LEN)|(PECI_GET_DIB_RD_LEN)|(PECI_GET_DIB_CMD)|(PECI_GET_TEMP_WR_LEN)|(PECI_GET_TEMP_RD_LEN)|(PECI_GET_TEMP_CMD)|(PECI_RDPKGCFG_WRITE_LEN)|(PECI_RDPKGCFG_READ_LEN_BASE)|(PECI_RDPKGCFG_CMD)|(PECI_MBX_INDEX_CPU_ID)|(PECI_MBX_INDEX_VR_DEBUG)|(PECI_MBX_INDEX_PKG_TEMP_READ)|(PECI_MBX_INDEX_ENERGY_COUNTER)|(PECI_MBX_INDEX_ENERGY_STATUS)|(PECI_MBX_INDEX_WAKE_MODE_BIT)|(PECI_MBX_INDEX_EPI)|(PECI_MBX_INDEX_PKG_RAPL_PERF)|(PECI_MBX_INDEX_PER_CORE_DTS_TEMP)|(PECI_MBX_INDEX_DTS_MARGIN)|(PECI_MBX_INDEX_SKT_PWR_THRTL_DUR)|(PECI_MBX_INDEX_CFG_TDP_CONTROL)|(PECI_MBX_INDEX_CFG_TDP_LEVELS)|(PECI_MBX_INDEX_DDR_DIMM_TEMP)|(PECI_MBX_INDEX_CFG_ICCMAX)|(PECI_MBX_INDEX_TEMP_TARGET)|(PECI_MBX_INDEX_CURR_CFG_LIMIT)|(PECI_MBX_INDEX_DIMM_TEMP_READ)|(PECI_MBX_INDEX_DRAM_IMC_TMP_READ)|(PECI_MBX_INDEX_DDR_CH_THERM_STAT)|(PECI_MBX_INDEX_PKG_POWER_LIMIT1)|(PECI_MBX_INDEX_PKG_POWER_LIMIT2)|(PECI_MBX_INDEX_TDP)|(PECI_MBX_INDEX_TDP_HIGH)|(PECI_MBX_INDEX_TDP_UNITS)|(PECI_MBX_INDEX_RUN_TIME)|(PECI_MBX_INDEX_CONSTRAINED_TIME)|(PECI_MBX_INDEX_TURBO_RATIO)|(PECI_MBX_INDEX_DDR_RAPL_PL1)|(PECI_MBX_INDEX_DDR_PWR_INFO_HIGH)|(PECI_MBX_INDEX_DDR_PWR_INFO_LOW)|(PECI_MBX_INDEX_DDR_RAPL_PL2)|(PECI_MBX_INDEX_DDR_RAPL_STATUS)|(PECI_MBX_INDEX_DDR_HOT_ABSOLUTE)|(PECI_MBX_INDEX_DDR_HOT_RELATIVE)|(PECI_MBX_INDEX_DDR_THROTTLE_TIME)|(PECI_MBX_INDEX_DDR_THERM_STATUS)|(PECI_MBX_INDEX_TIME_AVG_TEMP)|(PECI_MBX_INDEX_TURBO_RATIO_LIMIT)|(PECI_MBX_INDEX_HWP_AUTO_OOB)|(PECI_MBX_INDEX_DDR_WARM_BUDGET)|(PECI_MBX_INDEX_DDR_HOT_BUDGET)|(PECI_MBX_INDEX_PKG_PSYS_PWR_LIM3)|(PECI_MBX_INDEX_PKG_PSYS_PWR_LIM1)|(PECI_MBX_INDEX_PKG_PSYS_PWR_LIM2)|(PECI_MBX_INDEX_PKG_PSYS_PWR_LIM4)|(PECI_MBX_INDEX_PERF_LIMIT_REASON)|(PECI_PKG_ID_CPU_ID)|(PECI_PKG_ID_PLATFORM_ID)|(PECI_PKG_ID_UNCORE_ID)|(PECI_PKG_ID_MAX_THREAD_ID)|(PECI_PKG_ID_MICROCODE_REV)|(PECI_PKG_ID_MACHINE_CHECK_STATUS)|(PECI_WRPKGCFG_WRITE_LEN_BASE)|(PECI_WRPKGCFG_READ_LEN)|(PECI_WRPKGCFG_CMD)|(PECI_MBX_INDEX_DIMM_AMBIENT)|(PECI_MBX_INDEX_DIMM_TEMP)|(PECI_RDIAMSR_WRITE_LEN)|(PECI_RDIAMSR_READ_LEN)|(PECI_RDIAMSR_CMD)|(PECI_WRIAMSR_CMD)|(PECI_RDIAMSREX_WRITE_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DUMP_AGENT_ID)|(PECI_CRASHDUMP_AGENT_PARAM)|(PECI_CRASHDUMP_ENABLED)|(PECI_CRASHDUMP_NUM_AGENTS)|(PECI_CRASHDUMP_AGENT_DATA)|(PECI_CRASHDUMP_DISC_WRITE_LEN)|(PECI_CRASHDUMP_DISC_READ_LEN_BASE)|(PECI_CRASHDUMP_DISC_VERSION)|(PECI_CRASHDUMP_DISC_OPCODE)|(PECI_CRASHDUMP_GET_FRAME_WRITE_LEN)|(PECI_CRASHDUMP_GET_FRAME_READ_LEN_BASE)|(PECI_CRASHDUMP_GET_FRAME_VERSION)|(PECI_CRASHDUMP_GET_FRAME_OPCODE)|(PECI_CRASHDUMP_CMD)|PECI_IOC_BASE) }