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

2021-12-29 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked an inline comment as done. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + zwliew wrote: > zwliew wrote:

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

2021-12-28 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + zwliew wrote: > HazardyKnusperkeks wrote: > > zwliew wrote: > > > HazardyKnusperkeks wrote: > >

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

2021-12-28 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + HazardyKnusperkeks wrote: > zwliew wrote: > > HazardyKnusperkeks wrote: > > > zwliew wrote: > >

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

2021-12-28 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + zwliew wrote: > HazardyKnusper

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

2021-12-27 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + HazardyKnusperkeks wrote: > zwliew wrote: > > Is there a reason behind limiting the number of c

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

2021-12-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked an inline comment as done. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + zwliew wrote: > Is there a rea

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

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3067 + if (!ChildFormatTextToApply.empty()) { +assert(ChildFormatTextToApply.size() == 1); + Is there a reason behind limiting the number of children configs to 1 in this case? When the f

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

2021-02-14 Thread Björn Schäpers via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG25f753c51e7b: [clang-format] Add possibility to be based on parent directory (authored by HazardyKnusperkeks). Repository: rG LLVM Github Monorepo

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

2021-02-02 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 320886. HazardyKnusperkeks marked an inline comment as done. HazardyKnusperkeks added a comment. Silence unused variable warnings in release and using `llvm::reverse` with range based for. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2021-02-02 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks added a comment. In D93844#2536354 , @njames93 wrote: > As a follow up it may be wise to pass a diag handler to parseConfiguration as > when we parse it a second time, we probably wan

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

2021-02-02 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. As a follow up it may be wise to pass a diag handler to parseConfiguration as when we parse it a second time, we probably want to disregard any warnings (like unknown key) detected as they will have been printed on the first pass. Comment at: clang/l

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

2021-02-01 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 320589. HazardyKnusperkeks marked an inline comment as done. HazardyKnusperkeks added a comment. Fixed documentation (and rebased). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93844/new/ https://re

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

2021-02-01 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 3 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:160 +parent directory (or its parent if there is none). If there is no parent +file found it falls back to the ``LLVM`` style.

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

2021-02-01 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:160 +parent directory (or its parent if there is none). If there is no parent +file found it falls back to the ``LLVM`` style. + Why should it fallback to LLVM and not the

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

2021-01-28 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 320058. HazardyKnusperkeks added a comment. Rebased and Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93844/new/ https://reviews.llvm.org/D93844 Files: clang/docs/ClangFormatStyleOptions.rst

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

2021-01-19 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 317679. HazardyKnusperkeks added a comment. Found and fixed the case when no `BasedOnStyle` apart from `InheritParentConfig` is used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93844/new/ https:/

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

2021-01-18 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D93844#2504388 , @HazardyKnusperkeks wrote: > In D93844#2504376 , @MyDeveloperDay > wrote: > >> What I can't easily tell from the tests is if you are overriding any styles >

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

2021-01-18 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D93844#2504376 , @MyDeveloperDay wrote: > What I can't easily tell from the tests is if you are overriding any styles > defined in the parent with a local style. Yes I do, but I will try to make it clearer in the t

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

2021-01-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. What I can't easily tell from the tests is if you are overriding any styles defined in the parent with a local style. Comment at: clang/include/clang/Format/Format.h:57 + // the parent directories. It is not part of the actual style for formatt

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

2021-01-18 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 317295. HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks edited the summary of this revision. HazardyKnusperkeks added a comment. - Rebased - Renamed to `InhteritParentConfig` - Reworked to remove the recursion of `getStyle` -

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

2020-12-30 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang/lib/Format/Format.cpp:2962 +llvm::sys::path::filename(FileName)); +if (auto OuterStyle = getStyle(DefaultFormatStyle, FileForLanguage, + Fal

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

2020-12-29 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D93844#2473725 , @MyDeveloperDay wrote: > I like what you are suggesting, do you think `BasedOnStyle: File` is the best > terminology as the term `File` is used elsewhere to mean read from the > .clang_format file,

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

2020-12-29 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. I like what you are suggesting, do you think `BasedOnStyle: File` is the best terminology as the term `File` is used elsewhere to mean read from the .clang_format file, how about `BasedOnStyle: Inherit` `BasedOnStyle: InheritFromParent` `BasedOnStyle: InheritFrom

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

2020-12-29 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D93844#2472352 , @njames93 wrote: > In D93844#2472346 , @MyDeveloperDay > wrote: > >> I'm a little confused why this is needed as clang-format always read up the >> directory

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

2020-12-27 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In 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

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

2020-12-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In 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 c

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

2020-12-27 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. 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? Repository: rG LLVM

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

2020-12-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks created this revision. HazardyKnusperkeks added reviewers: MyDeveloperDay, curdeius, krasimir, klimek, njames93, mitchell-stellar. HazardyKnusperkeks added a project: clang-format. HazardyKnusperkeks requested review of this revision. Herald added a project: clang. Herald added