[PATCH] D72326: [clang-format] Add option to explicitly specify a config file

2021-12-30 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396579. zwliew added a comment. Fixed rebase and diff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72326/new/ https://reviews.llvm.org/D72326 Files: clang/docs/ClangFormat.rst clang/docs/ClangFormatStyleO

[PATCH] D72326: [clang-format] Add option to explicitly specify a config file

2021-12-30 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396578. zwliew added a comment. Herald added subscribers: llvm-commits, openmp-commits, libcxx-commits, lldb-commits, Sanitizers, arjunp, sdasgup3, luke957, asavonic, jeroen.dobbelaere, wenzhicui, wrengr, Chia-hungDuan, armkevincheng, ormris, foad, eric-k256,

[PATCH] D72326: [clang-format] Add option to explicitly specify a config file

2021-12-30 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added a comment. Herald added a subscriber: JDevlieghere. Oh no...I'm so sorry. Didn't mean to cause this large diff. Trying to fix it now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72326/new/ https://reviews.llvm.org/D72326 __

[PATCH] D116371: [clang-format] Support inheriting from more than 1 parents in the fallback case

2021-12-29 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396580. zwliew added a comment. Herald added a subscriber: cfe-commits. Rebased on master for context. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116371/new/ https://reviews.llvm.org/D116371 Files: clang/l

[PATCH] D72326: [clang-format] Add option to explicitly specify a config file

2021-12-29 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added a comment. Thanks for the review. I've moved the unrelated change to https://reviews.llvm.org/D116371 instead. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72326/new/ https://reviews.llvm.org/D72326 ___ cfe-commits mailing list

[PATCH] D72326: [clang-format] Add option to explicitly specify a config file

2021-12-29 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396519. zwliew retitled this revision from "[clang-format] Rebased on master: Add option to specify explicit config file" to "[clang-format] Add option to explicitly specify a config file". zwliew edited the summary of this revision. zwliew added a comment. A

[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] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-28 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3393 if (!ChildFormatTextToApply.empty()) { assert(ChildFormatTextToApply.size() == 1); HazardyKnusperkeks wrote: > zwliew wrote: > > Is there a reason for this to be limited to 1? I

[PATCH] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-28 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396458. zwliew added a comment. Support inheritance in a chain of more than 1 parents I made the following changes: 1. Refactor the code for loading and parsing configs into a separate function 2. Add a new test case (9.1.2) to test the case mentioned in ht

[PATCH] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-28 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added a comment. In D72326#3211701 , @HazardyKnusperkeks wrote: > Do you plan to refactor something for this review, or do you think you are > done? Then I will look at it again as a whole. I'm going to try refactoring the code for loading and pa

[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] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-27 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3276 + // Check for explicit config filename + if (StyleName.startswith_insensitive("file:")) { +auto StyleNameFile = StyleName.substr(5); HazardyKnusperkeks wrote: > zwliew wrote: > > Fo

[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] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396274. zwliew added a comment. Add a test for inheritance from parent config with base Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72326/new/ https://reviews.llvm.org/D72326 Files: clang/docs/ClangFormat.r

[PATCH] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added inline comments. Comment at: clang/lib/Format/Format.cpp:3393 if (!ChildFormatTextToApply.empty()) { assert(ChildFormatTextToApply.size() == 1); Is there a reason for this to be limited to 1? I came across this case during testing, but I c

[PATCH] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew updated this revision to Diff 396273. zwliew added a comment. Support inheritance from parent configs via `BasedOnStyle: InheritParentConfig` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72326/new/ https://reviews.llvm.org/D72326 Files:

[PATCH] D116299: [clang-format] Apply multiple children configs on fallback style

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew created this revision. zwliew requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Allow multiple children configs to be applied on top of the fallback style. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D116299 File

[PATCH] D116298: Add option to specify explicit config file

2021-12-26 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew created this revision. zwliew requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Specify a specific config file using --style=file:path/to/config/file Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D116298 Files: c

[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] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-24 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added a comment. On further thought, the logic for `loadConfigFile()` looks incomplete. It does not properly handle the `InheritParentConfig` argument for `BasedOnStyle`. In fact, `loadConfigFile()` should probably use the same logic as that for `-style=file`. I can look into making this

[PATCH] D72326: [clang-format] Rebased on master: Add option to specify explicit config file

2021-12-24 Thread Zhao Wei Liew via Phabricator via cfe-commits
zwliew added a comment. Hi, I'd like to help to get this patch accepted and merged. I have a few suggestions/questions below, and I can help make any changes to the patch if needed! Comment at: clang/docs/ClangFormatStyleOptions.rst:35 +When using ``-style=file:, :program:`