[PATCH] D93844: [clang-format] Add possibility to be based on parent directory

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 27 15:03:08 PST 2020


HazardyKnusperkeks added a comment.

In D93844#2472346 <https://reviews.llvm.org/D93844#2472346>, @MyDeveloperDay wrote:

> I'm a little confused why this is needed as clang-format always read up the directory tree until it see a .clang-format file, perhaps I don't quite understand the use case. Can't you just have a different .clang-format in the subdirectory?

Yes of course I can, but I don't want to copy everything except the one thing I want to change.

I have one .clang-format in my main directory and since I only want to change the column limit for my tests I want to write a .clang-format in the test directory with the content:

  BasedOnStyle: File
  ColumnLimit: 0

So when I change (or better add) a value in my main .clang-format it will also apply to my tests, without touching their file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93844



More information about the cfe-commits mailing list