This is an archive of the discontinued LLVM Phabricator instance.

[libc] add test formatting rules
AbandonedPublic

Authored by michaelrj on Dec 21 2021, 1:11 PM.

Details

Reviewers
sivachandra
lntue
Summary

Add an invocation of clang tidy that applies to the tests for LLVM-libc.
The next patch will include the actual changes made by applying the new
formatting rules.

Diff Detail

Event Timeline

michaelrj created this revision.Dec 21 2021, 1:11 PM
michaelrj requested review of this revision.Dec 21 2021, 1:11 PM
sivachandra added inline comments.Dec 21 2021, 1:46 PM
libc/test/src/string/memory_utils/.clang-tidy
1

I would actually vote for not adding any of these .clang-tidy files in this round. Just the CMake change to run clang-tidy for the tests should be sufficient as it will then use the main .clang-tidy file which is good enough to start with. WDYT?

michaelrj added inline comments.Dec 21 2021, 2:17 PM
libc/test/src/string/memory_utils/.clang-tidy
1

The problem is that each of these .clang-tidy files have reasons behind them. The other two are there because those files are matching external interfaces that we can't change, and so reformatting them is unhelpful. This file is because clang-tidy will fully crash if it tries to format utils_test.cpp, for which I filed a bug here: https://github.com/llvm/llvm-project/issues/52825. I can remove the other two files, although it will cause a lot of log spam from the formatter being confused about functions with names that don't match our formatting, but are defined by gtest or MPFR (e.g. addTest). On the other hand, there's already a lot of log spam from the files that also implement the gtest interface, but are not in that folder (e.g. TmMatcher).

sivachandra added inline comments.Dec 21 2021, 9:39 PM
libc/test/src/string/memory_utils/.clang-tidy
1

Lets do it this way then. Can you land it https://reviews.llvm.org/D116127 as a separate cleanup patch? We will play with this change after that to better understand how to proceed.

michaelrj added inline comments.Dec 22 2021, 10:41 AM
libc/test/src/string/memory_utils/.clang-tidy
1

SGTM

michaelrj abandoned this revision.Feb 2 2023, 11:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 11:35 AM