Skip to content

[libc] Improve the state of the lint rules #135278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ CheckOptions:
value: CamelCase
- key: readability-identifier-naming.StructCase
value: aNy_CasE
- key: readability-identifier-naming.StructIgnoredRegexp
value: "_?(_[A-Za-z0-9]+)*"
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberIgnoredRegexp
Expand All @@ -14,6 +16,10 @@ CheckOptions:
value: lower_case
- key: readability-identifier-naming.VariableIgnoredRegexp
value: "_?(_[A-Za-z0-9]+)*"
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterIgnoredRegexp
value: "_?(_[A-Za-z0-9]+)*"
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.FunctionIgnoredRegexp
Expand All @@ -26,6 +32,8 @@ CheckOptions:
value: UPPER_CASE
- key: readability-identifier-naming.ConstexprVariableCase
value: UPPER_CASE
- key: readability-identifier-naming.ConstexprVariableIgnoredRegexp
value: "is(_[A-Za-z0-9]+)*_v"
- key: readability-identifier-naming.ConstexprFunctionCase
value: lower_case
- key: readability-identifier-naming.GetConfigPerFile
Expand Down
2 changes: 1 addition & 1 deletion libc/cmake/modules/LLVMLibCObjectRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function(create_entrypoint_object fq_target_name)
# Until this is fixed upstream, we use -fno-caret-diagnostics to surpress
# these.
COMMAND ${LLVM_LIBC_CLANG_TIDY}
"--extra-arg=-fno-caret-diagnostics" --quiet
"--extra-arg=-fno-caret-diagnostics" --quiet --fix
# Path to directory containing compile_commands.json
-p ${PROJECT_BINARY_DIR}
${ADD_ENTRYPOINT_OBJ_SRCS}
Expand Down
3 changes: 3 additions & 0 deletions libc/include/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
InheritParentConfig: false
Checks: ''
HeaderFilterRegex: '.*'
2 changes: 1 addition & 1 deletion libc/src/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ HeaderFilterRegex: '.*'
WarningsAsErrors: 'llvmlibc-*'
CheckOptions:
- key: llvmlibc-restrict-system-libc-headers.Includes
value: '-*, linux/*, asm/*.h, asm-generic/*.h'
value: '-*, linux/*, asm/*.h, asm-generic/*.h. sys/syscall.h'
Loading