[llvm-dev] [RFC] Semi-Automatic clang-format of files with low frequency
Timothy Keith via llvm-dev
llvm-dev at lists.llvm.org
Tue Jun 30 16:54:37 PDT 2020
The flang sub-project is supposed to be fully formatted so it wouldn’t be hard to get to 100% for a test like this and we would be happy to participate. We were at 100% at one point but there are about 10 files that need formatting now, in part because of changes to clang-format. It would be good to get early warning of clang-format changes like that.
Let me know if there is anything I can do to help.
From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org>
On Jun 28, 2020, at 8:30 AM, MyDeveloper Day via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
(Copying from Discourse)
A couple of months ago I added the following page documentation Clang-Formatted-Status<http://clang.llvm.org/docs/ClangFormattedStatus.html> to track the status of “How Much” clang-formatted the
LLVM/Clang project is.
Wow, I hadn’t seen this - this is really cool!
I’m a contributor to clang-format and would like to see LLVM 100% clang formatted so we can use LLVM as a massive test-suite for clang-format when we make changes.
In the last couple of months since we added this page the % has gone up by ~4% and this is likely in most part of either: a mention in LLVM-Weekly, the premerge checks or perhaps some recent clang-format efforts by individuals. This is fantastic and every directory that gets to 100% increase the directories that I can run against to check against.
I’m a huge fan of clang-format, and have worked in “required to be formatted” code bases - it is a way better way to work in my opinion. That said, such a move that you’re talking about is something that will take time, because this is a social problem as well as a technical one.
Instead of starting from a “can we do everything” question (which you’re already getting some “no’s”), I’d start with an easier question of “is anyone ok with mechanically formatting any pieces of llvm?” There will be some folks (e.g. the MLIR ones, perhaps the flang ones?) that are more likely to be early adopters, and this gives the opportunity to figure out policies and tools to help maintain things. Then you can move on to other subdirectories within llvm/clang/etc, and progressively get there.
This helps achieve your goal of getting more of the stack, but avoids it being an “all or nothing” sort of dichotomy.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev