Re: [PATCH v3 8/8] ci/style-check: add `RemoveBracesLLVM` to '.clang-format'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 15, 2024, 19:45 UTC
- Message-ID
- <xmqqcyne30eb.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZQx4UKMfq7q2GMV6nYQGKeCj0dW_P4kG7yDTcdo--1HHQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 15 quoted lines
>> If we know we can write into /tmp/clang-format-rules file, then the
>> CI script can do something like
>>
>> {
>> cat .clang-format
>> echo echo "RemoveBracesLLVM: true"
>> } >/tmp/clang-format-rules
>> git clang-format --style=file:/tmp/clang-format-rules \
>> --diff --extensions c,h "$baseCommit"
>>
>> right? Then "git status" would even say "there is no untracked
>> cruft" (although I do not know we *need* to keep the working tree
>> that clean, without untracked cruft).
>
> Yes this is the best solution.FWIW, I think an in-tree throw-away file is a better option, simply because we _know_ that the working tree can be written (by the fact that we can do "make" and have compilers write *.o and other cruft), but we do not know if the CI environment allows us to write to /tmp or /var/tmp or /usr/local/tmp and you do not want to run around and see if there is a suitable temporary directory you can use.