[llvm-dev] [RFC] Semi-Automatic clang-format of files with low frequency

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 30 13:47:48 PDT 2020



> On Jun 28, 2020, at 8:30 AM, MyDeveloper Day via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> (Copying from Discourse)
> 
> All
> 
> 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.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200630/09986695/attachment.html>


More information about the llvm-dev mailing list