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

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 1 13:18:56 PDT 2020


Great idea!

Interestingly, there is a .clang-format in clang/test, but it only
removes the column limit. clang-formatting every file .cpp file breaks
914 tests.

Michael


Am Mi., 1. Juli 2020 um 14:31 Uhr schrieb Sam Elliott <selliott at lowrisc.org>:
>
> You can achieve the same as a `.clang-format-ignore` for vendored directories by putting a `.clang-format` in those directories which turns off formatting (IIRC, this takes two lines). What's more, this works with old versions of clang-format!
>
> Sam
>
> On 1 Jul 2020, at 8:22 pm, MyDeveloper Day via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> We recently had a suggestion about introducing a .clang-format-ignore file, it seems there could be value in that for areas of which you don't want to ever format.
>
> Anyone undertaking a global clang-format without prior knowledge of the specific area wouldn't necessarily know that.
>
> MyDeveloperDay
>
> On Wed, Jul 1, 2020 at 6:14 PM Michael Kruse <llvmdev at meinersbur.de> wrote:
>>
>> Am Mi., 1. Juli 2020 um 05:46 Uhr schrieb MyDeveloper Day via llvm-dev
>> <llvm-dev at lists.llvm.org>:
>> > I always knew "polly" was mostly clean too, and actually one of the areas I already test against, (along with lib/Format obviously).
>>
>> You have no other choice.
>> Polly verifies its source formatting as part of check-polly, so every
>> commit that violates formatting will get an email from the buildbot.It
>> also triggers when clang-format itself changes. Did you find those
>> helpful?
>>
>> The parts of Polly that are left out are its external dependencies,
>> i.e. isl and imath. I wonder why these are even included in the
>> clang-format status, we certainly do not want to modify these source
>> files.
>>
>> For clang, I have to exclude the test folder because clang-format
>> messes with clang -verify tests that require comments on specific
>> lines and tests that check correct behavior of clang on whitespace.
>>
>>
>> Michael
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
> --
> Sam Elliott
> Software Team Lead
> Senior Software Developer - LLVM and OpenTitan
> lowRISC CIC
>


More information about the llvm-dev mailing list