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

MyDeveloper Day via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 1 12:35:36 PDT 2020


I was more thinking about excluding some/not all files in certain
directories rather than excluding the whole directory/tree (ala .gitignore
pattern), but you are correct it could be disabled in this way.

MyDeveloperDay.

On Wed, Jul 1, 2020 at 8:31 PM Sam Elliott <selliott at lowrisc.org> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200701/7a7e11f1/attachment.html>


More information about the llvm-dev mailing list