[libc-commits] [PATCH] D114301: [libc] update tidy rules to fix variable formatting

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Nov 19 16:52:20 PST 2021


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
michaelrj requested review of this revision.
Herald added a subscriber: aheejin.

This commit changes the clang-tidy rules for LLVM-libc to follow the new
format. The next commit applies these rules to the codebase.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114301

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake
  libc/src/.clang-tidy


Index: libc/src/.clang-tidy
===================================================================
--- libc/src/.clang-tidy
+++ libc/src/.clang-tidy
@@ -1,6 +1,16 @@
-Checks: '-*,llvmlibc-*'
+Checks: '-*,llvmlibc-*,readability-identifier-naming'
 HeaderFilterRegex: '.*'
 WarningsAsErrors: 'llvmlibc-*'
 CheckOptions:
   - key:             llvmlibc-restrict-system-libc-headers.Includes
     value:           '-*, linux/*, asm/*.h, asm-generic/*.h'
+  - key:             readability-identifier-naming.VariableCase
+    value:           lower_case
+  - key:             readability-identifier-naming.FunctionCase
+    value:           lower_case
+  - key:             readability-identifier-naming.GlobalFunctionCase
+    value:           aNy_CasE
+  - key:             readability-identifier-naming.ConstexprVariableCase
+    value:           UPPER_CASE
+  - key:             readability-identifier-naming.ClassCase
+    value:           CamelCase
Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -232,6 +232,7 @@
       # these.
       COMMAND $<TARGET_FILE:clang-tidy>
               "--extra-arg=-fno-caret-diagnostics" --quiet
+              "--export-fixes=${CMAKE_CURRENT_BINARY_DIR}/${target_name}.yaml"
               # Path to directory containing compile_commands.json
               -p ${PROJECT_BINARY_DIR}
               ${ADD_ENTRYPOINT_OBJ_SRCS}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114301.388669.patch
Type: text/x-patch
Size: 1530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20211120/9f813b50/attachment.bin>


More information about the libc-commits mailing list