[PATCH] D68551: [clang-format] [NFC] Ensure clang-format is itself clang-formatted.

Michael Kruse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 11:26:42 PDT 2019


Meinersbur added a comment.

In D68551#1697842 <https://reviews.llvm.org/D68551#1697842>, @mitchell-stellar wrote:

> I agree that a system in place that either enforces clang-formatting on commit or after the fact would be ideal. Otherwise, I don't see a need to have to approve these NFC commits.


The current coding policy <https://llvm.org/docs/CodingStandards.html#introduction> contains "Our long term goal is for the entire codebase to follow the convention, but we explicitly do not want patches that do large-scale reformatting of existing code." that was added after someone removed all trailing whitespace all LLVM files. Reformatting the code you are going to work in is fine, but not on the entire code base. Ideally we'd also run the regression tests in a pre-commit hook.

Btw, I am the author of the CMakeLists snippet quoted by @MyDeveloperDay. Before that, it was a shell script that didn't run on Windows. Making it part of the regression test basically eliminated all discussion about code formatting, but we had to run large-scale reformatting whenever clang-format changed in some way. It also runs by the polly-* buildbots which I personally do not like since I don't see code formatting as a reason why a build should fail.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68551/new/

https://reviews.llvm.org/D68551





More information about the cfe-commits mailing list