[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
Mon Dec 6 16:51:54 PST 2021
michaelrj added inline comments.
================
Comment at: libc/CMakeLists.txt:63
+ Checks: cppcoreguidelines-avoid-goto")
+ endif()
else()
----------------
sivachandra wrote:
> Do we still require this?
yes. The variables in `build/projects/libc/config/linux/syscall.h` are of a specific format (that being the names of specific registers), and the formatter will raise errors if those aren't specifically ignored.
================
Comment at: libc/src/.clang-tidy:3
HeaderFilterRegex: '.*'
WarningsAsErrors: 'llvmlibc-*'
CheckOptions:
----------------
sivachandra wrote:
> Can we add `readability-*` rules also to this list?
not with the patch as it currently is, because in the generated `signal.h` file, the function `sigaction` is being renamed to `__sigaction` by the macro `#define sigaction __sigaction`, which for some reason ignores all of the exceptions I have put in place to handle it. If we rename the struct `__sigaction` to something that the linter doesn't think would be formatted to `sigaction` (e.g. `__sigaction_struct`) then it works fine, but I don't know if that's an acceptable solution.
================
Comment at: libc/src/.clang-tidy:24
+ - key: readability-identifier-naming.GlobalFunctionIgnoredRegexp
+ value: "^.+$"
+ - key: readability-identifier-naming.ConstexprVariableCase
----------------
sivachandra wrote:
> Do we still need this blanket ignore?
No, removed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114301/new/
https://reviews.llvm.org/D114301
More information about the libc-commits
mailing list