From 63c8172d111c8b1d7041d6d729b1fd17ea8cf9f0 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Mon, 25 Mar 2024 10:02:49 +0800 Subject: [PATCH] Enforce UpperCamelCase for local variables --- .clang-tidy | 17 ++++++++++++++++- src/base/.clang-tidy | 1 + src/tools/.clang-tidy | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/base/.clang-tidy create mode 100644 src/tools/.clang-tidy diff --git a/.clang-tidy b/.clang-tidy index d41c71378..3c7bbbd94 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -77,7 +77,6 @@ Checks: > -readability-function-cognitive-complexity, -readability-function-size, -readability-identifier-length, - -readability-identifier-naming, -readability-implicit-bool-conversion, -readability-isolate-declaration, -readability-magic-numbers, @@ -89,3 +88,19 @@ Checks: > performance-*, -performance-no-int-to-ptr, portability-*, + +WarningsAsErrors: + readability-identifier-naming, + +CheckOptions: + - key: readability-identifier-naming.LocalVariableCase + value: CamelCase + - key: readability-identifier-naming.StaticConstantCase + value: aNy_CasE + - key: readability-identifier-naming.StaticVariableCase + value: aNy_CasE + - key: readability-identifier-naming.LocalConstantCase + value: aNy_CasE + - key: readability-identifier-naming.LocalVariableIgnoredRegexp + value: '^(p|a|s_|FT_|TB_|s_|ul_|v|[xy]i$|[zijklxyhmrgbacwestnduvqf]$|[dmpwsitcf][xy]$|(ch|skel)[0-2]?$|it$|tw$|dt$|th$|ls$|func$|res$|shader$|len$|maxLength$|length$|offset$|offpos$|result$|bg$|sp$|url$|Tickdelta_legacy$|index$|ctxt$|key$|null$|logger$|LAST_MODIFIED$|GfxFsaaSamples_MouseButton$|teleNr$|target$|id$|hit$|hsl[0-2]?$|rgb[0-2]?$|dir$|tmp$|cData$|sub$|ret$|rendered$|(lower|upper)(16|26|24|32)|size$|wSearch$|bAlreadyHit$|isWeaponCollide$|zerochar$|dist$|sound$|match$|best_skin$|best_matches$|m_aClient$|matches$|nohook$|through_cut$|btn$|savedLayers$|l[hw]$|evilz$|sec$|min$|to2$|delay$|m_TileF?Index$|mode$|maxModes$|numModes$|iLogLength$|[xy]Fract$|[xy]Int$|imgg[xy]$|skip$|localPlayer$|fdratio$|[rgbat][0-2]$|[xy][0-3]$|x[rl]$).*' + diff --git a/src/base/.clang-tidy b/src/base/.clang-tidy new file mode 100644 index 000000000..6d6f9e5d5 --- /dev/null +++ b/src/base/.clang-tidy @@ -0,0 +1 @@ +Checks: '-readability-identifier-naming' diff --git a/src/tools/.clang-tidy b/src/tools/.clang-tidy new file mode 100644 index 000000000..6d6f9e5d5 --- /dev/null +++ b/src/tools/.clang-tidy @@ -0,0 +1 @@ +Checks: '-readability-identifier-naming'