Page MenuHomePhabricator

Typz (Francois Ferrand)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 25 2017, 12:43 AM (103 w, 3 d)

Recent Activity

Nov 27 2018

Typz added a comment to D50078: clang-format: support aligned nested conditionals formatting.

ping ?

Nov 27 2018, 9:13 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

ping?

Nov 27 2018, 8:56 AM
Typz added a comment to D50147: clang-format: support external styles.

ping?

Nov 27 2018, 8:55 AM

Oct 29 2018

Typz added a comment to D50147: clang-format: support external styles.

Being able to discover the right style from the filesystem is powerful, and if I was going to use this flag, I'd consider symlinking the style-file to subproject/.clang_format instead. That way the setting is persistent and available to all tools, rather than us needing to get it right on each invocation.

Oct 29 2018, 10:41 AM
Typz added a comment to D50147: clang-format: support external styles.

The idea here does seem to be a natural extension of -style, at least for the case when the arg is a filename directly. I'm not opposed, happy to review this.

I do want to probe the use case a bit though: we have found that configuring via -style= doesn't scale that well to lots of codebases and tools. e.g. if someone's running clang-tidy or clangd via some driver, are they going to have a way to plumb through the right -style=?

Being able to discover the right style from the filesystem is powerful, and if I was going to use this flag, I'd consider symlinking the style-file to subproject/.clang_format instead. That way the setting is persistent and available to all tools, rather than us needing to get it right on each invocation.

Oct 29 2018, 10:28 AM

Oct 4 2018

Typz added a comment to D37813: clang-format: better handle namespace macros.

The problem here is that we have different opinions on how the formatting on namespace macros should behave in the first place- I think they should behave like namespaces, you want them to be formatted differently.
Given that you want full control over the formatting of those macros, and them not actually be formatted exactly like namespaces or classes, I think we need a more generic mechanism for you to express that.

Not sure what you mean here. I want them to behave like namespaces as well, this is actually the use case I have... As implemented, they indeed behave exactly like namespaces :

TESTSUITE(a) {                       namespace a {
} // TESTSUITE(a)                    } // namespace a
                                VS
TESTSUITE(a) { TESTSUITE(b) {        namespace a { namespace b {
} // TESTSUITE(a::b)                 }} // namespace a::b

I thought we had the discussion upthread that they indent differently from namespaces. I'm working on a patch that allows you to configure macros.

Oct 4 2018, 2:59 AM

Oct 3 2018

Typz added a comment to D37813: clang-format: better handle namespace macros.

The problem here is that we have different opinions on how the formatting on namespace macros should behave in the first place- I think they should behave like namespaces, you want them to be formatted differently.
Given that you want full control over the formatting of those macros, and them not actually be formatted exactly like namespaces or classes, I think we need a more generic mechanism for you to express that.

Oct 3 2018, 8:39 AM

Oct 2 2018

Typz committed rC343602: clang-format: better handle statement macros.
clang-format: better handle statement macros
Oct 2 2018, 9:42 AM
Typz committed rL343602: clang-format: better handle statement macros.
clang-format: better handle statement macros
Oct 2 2018, 9:41 AM
Typz closed D33440: clang-format: better handle statement macros.
Oct 2 2018, 9:41 AM

Sep 25 2018

Typz added a comment to D50147: clang-format: support external styles.

I don't understand the use-case this patch is realizing. Suppose I have a bunch of projects that have to share a format style. Then I can checkout them under a common root directory and put an appropriate .clang-format file there.

Sep 25 2018, 1:50 AM

Sep 4 2018

Typz added a comment to D50147: clang-format: support external styles.

clang-format does indeed support .clang-format, which is great for *isolated* projects, and which is not affected by this patch.

Sep 4 2018, 8:51 AM

Aug 1 2018

Typz created D50147: clang-format: support external styles.
Aug 1 2018, 9:50 AM
Typz added a comment to D50078: clang-format: support aligned nested conditionals formatting.

Could you clarify how each piece is supposed to be aligned in these examples?
This is what makes me happy:

// column  limit             V
int a = condition1 ? result1
      : conditio2 ? result2
      : loooooooooocondition 
        ? result2
        : dition3 ? resul3
                  : resul4;
// column  limit             V
int a = condition1 
        ? loooooresult1
        : conditio2 ? result2
                    : result4;
Aug 1 2018, 7:22 AM
Typz added a comment to D50078: clang-format: support aligned nested conditionals formatting.
  • I'd be ok with the suggestion for BreakBeforeTernaryOperators=true
Aug 1 2018, 6:56 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

This has been stale for a while now. Last comment indicate this is not the right approach, but some prototyping has been done a more generic approach, with no timeline.
I understand this, but in the meantime the problem is still there, with no solution at the moment...

Aug 1 2018, 2:43 AM

Jul 31 2018

Typz updated the diff for D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch.

Regenerate documentation

Jul 31 2018, 9:59 AM
Typz updated the diff for D37813: clang-format: better handle namespace macros.

Regeneration documentation

Jul 31 2018, 9:52 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Regenerate documentation

Jul 31 2018, 9:50 AM
Typz added a comment to D50078: clang-format: support aligned nested conditionals formatting.

Notes:

  • I choose not to add an option to enable this behavior, as I think of it as just another way clang-format can (better) format the code; but I can one if needed
  • Currently, it relies on another patch (D32478), which supports aligning the wrapped operator slightly differently. If/since that other patch does not seem to make it, I can change this patch to either do the alignment in this specific case (e.g. for wrapped ternary operator only) or to keep the 'default' behavior of clang-format (e.g. the wrapped colon would be aligned with the first condition):
Jul 31 2018, 9:49 AM
Typz created D50078: clang-format: support aligned nested conditionals formatting.
Jul 31 2018, 9:31 AM
Typz updated the diff for D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

rebase

Jul 31 2018, 9:28 AM

Jun 14 2018

Typz committed rC334709: clang-format: Fix documentation generation.
clang-format: Fix documentation generation
Jun 14 2018, 6:36 AM
Typz committed rL334709: clang-format: Fix documentation generation.
clang-format: Fix documentation generation
Jun 14 2018, 6:36 AM
Typz closed D48161: clang-format: Fix documentation generation.
Jun 14 2018, 6:36 AM
Typz updated the diff for D48161: clang-format: Fix documentation generation.

rebase

Jun 14 2018, 6:35 AM
Typz updated the diff for D48161: clang-format: Fix documentation generation.

Add missing block, for consistency

Jun 14 2018, 2:23 AM
Typz retitled D48161: clang-format: Fix documentation generation from Fix documentation generation to clang-format: Fix documentation generation.
Jun 14 2018, 2:19 AM
Typz created D48161: clang-format: Fix documentation generation.
Jun 14 2018, 2:18 AM

Jun 12 2018

Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

The normal rule for formatting options apply. If you can dig up a public style guide and a project of reasonable size where it is used, we can add an option.

Jun 12 2018, 7:29 AM

Jun 11 2018

Typz committed rL334408: clang-format: Introduce BreakInheritanceList option.
clang-format: Introduce BreakInheritanceList option
Jun 11 2018, 7:46 AM
Typz committed rC334408: clang-format: Introduce BreakInheritanceList option.
clang-format: Introduce BreakInheritanceList option
Jun 11 2018, 7:45 AM
Typz closed D43015: clang-format: Introduce BreakInheritanceList option.
Jun 11 2018, 7:45 AM
Typz updated the diff for D43015: clang-format: Introduce BreakInheritanceList option.

rebase

Jun 11 2018, 7:43 AM

Jun 8 2018

Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

Would it be acceptable to introduce an option to allow enabling this behavior?
I mean would it have a chance of being integrated, or must I keep maintaining a fork of clang-format...

Jun 8 2018, 7:18 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

ping?

Jun 8 2018, 7:09 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

Jun 8 2018, 7:07 AM

May 17 2018

Typz added inline comments to D33440: clang-format: better handle statement macros.
May 17 2018, 4:51 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Address review comments

May 17 2018, 4:51 AM

May 16 2018

Typz updated the diff for D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch.

rebase

May 16 2018, 6:57 AM
Typz updated the diff for D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

Rebase

May 16 2018, 3:11 AM
Typz updated the diff for D37813: clang-format: better handle namespace macros.

Rebase

May 16 2018, 2:53 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

Some initial design work has been done, and Krasimir said that he's interested. No timeline though :(

May 16 2018, 2:53 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Rebase on latest master

May 16 2018, 2:38 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

May 16 2018, 1:56 AM
Typz updated the diff for D43015: clang-format: Introduce BreakInheritanceList option.

Rebase on latest master

May 16 2018, 1:55 AM
Typz committed rC332436: clang-format: Allow optimizer to break template declaration..
clang-format: Allow optimizer to break template declaration.
May 16 2018, 1:29 AM
Typz committed rL332436: clang-format: Allow optimizer to break template declaration..
clang-format: Allow optimizer to break template declaration.
May 16 2018, 1:29 AM
Typz closed D42684: clang-format: Allow optimizer to break template declaration..
May 16 2018, 1:29 AM
Typz updated the diff for D42684: clang-format: Allow optimizer to break template declaration..

Rebase on latest master & address review comments

May 16 2018, 1:27 AM
Typz committed rL332434: clang-format: tweak formatting of variable initialization blocks.
clang-format: tweak formatting of variable initialization blocks
May 16 2018, 1:07 AM
Typz committed rC332434: clang-format: tweak formatting of variable initialization blocks.
clang-format: tweak formatting of variable initialization blocks
May 16 2018, 1:07 AM
Typz closed D43290: clang-format: tweak formatting of variable initialization blocks.
May 16 2018, 1:07 AM
Typz updated the diff for D43290: clang-format: tweak formatting of variable initialization blocks.

Address review comment & rebase

May 16 2018, 1:04 AM

Mar 22 2018

Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

@djasper : ping?

Mar 22 2018, 8:00 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

@djasper : ping?

Mar 22 2018, 8:00 AM
Typz added a comment to D43290: clang-format: tweak formatting of variable initialization blocks.

@djasper : ping?

Mar 22 2018, 7:57 AM
Typz added a comment to D44765: PR36643 Make clang-format support more generic TMarcos.

You are right, I did not mean it would help with the handling of these macros; but it may be related on the configuration-side of things : adding an option for listing these macros may hit the same limitation, and the same mean of storing (in the code) the list of these macros may be used.

Mar 22 2018, 7:07 AM
Typz added a comment to D44765: PR36643 Make clang-format support more generic TMarcos.

A generic (or at least extandable) approach to specifying macro behaviors was introduced here: https://reviews.llvm.org/D33440

Mar 22 2018, 2:31 AM

Mar 13 2018

Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

ping?

Mar 13 2018, 6:30 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

Mar 13 2018, 6:29 AM
Typz added a comment to D43290: clang-format: tweak formatting of variable initialization blocks.

ping?

Mar 13 2018, 6:29 AM

Mar 9 2018

Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

ping?

Mar 9 2018, 2:39 AM
Typz added a comment to D43290: clang-format: tweak formatting of variable initialization blocks.

ping?

Mar 9 2018, 2:39 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

Mar 9 2018, 2:39 AM

Mar 5 2018

Typz added a comment to D43290: clang-format: tweak formatting of variable initialization blocks.

ping?

Mar 5 2018, 6:55 AM

Mar 2 2018

Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

Also double-checked with Richard Smith and he agrees that the current behavior is preferable. For comma and plus this doesn't seem overly important, but making it:

aaaaaaaaaa(bbbbbbbbb + ccccccccccc *
                       ddddddddd);

seems really bad to him as this suggests that we are adding both ccccccccccc and ddddddddd.

aaaaaaaaaa(bbbbbbbbb + ccccccccccc *
                           ddddddddd);

seems clearer.

Mar 2 2018, 7:02 AM
Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

If people don't care about this case, we might as well merge this :-) Just kidding.

Mar 2 2018, 4:12 AM

Mar 1 2018

Typz updated the diff for D42684: clang-format: Allow optimizer to break template declaration..

Change options values to No/MultiLine/Yes.

Mar 1 2018, 9:58 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

Mar 1 2018, 9:56 AM
Typz committed rC326426: [clang-format] Add SpaceBeforeColon option.
[clang-format] Add SpaceBeforeColon option
Mar 1 2018, 2:14 AM
Typz committed rL326426: [clang-format] Add SpaceBeforeColon option.
[clang-format] Add SpaceBeforeColon option
Mar 1 2018, 2:14 AM
Typz closed D32525: [clang-format] Add SpaceBeforeColon option.
Mar 1 2018, 2:14 AM
Typz closed D32525: [clang-format] Add SpaceBeforeColon option.
Mar 1 2018, 2:14 AM

Feb 28 2018

Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

But you *do* want extra indentation in the case of:

function(aaaaa, 
         bbbbb +
         cccccc);

I understand you argument, but I don't agree at the moment. As is (without getting more feedback from others that clang-format is behaving unexpected here), I do not want to move forward with this change.

Feb 28 2018, 9:35 AM
Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

Indeed, seems to apply to classes as well. Maybe I was mislead by my testing, where I did not get the case (possibly because we use ConstructorInitializerAllOnOneLineOrOnePerLine=true, so the continuation indenter only sees "short" class declarations unless breaking the template is required because the name is too long).

Feb 28 2018, 9:24 AM
Typz updated the diff for D43015: clang-format: Introduce BreakInheritanceList option.

Address review comments of https://reviews.llvm.org/D32525

Feb 28 2018, 9:13 AM
Typz added inline comments to D32525: [clang-format] Add SpaceBeforeColon option.
Feb 28 2018, 9:04 AM
Typz updated the diff for D32525: [clang-format] Add SpaceBeforeColon option.

Address review comments

Feb 28 2018, 9:03 AM
Typz updated the diff for D43015: clang-format: Introduce BreakInheritanceList option.

Address review comments, and rebase on https://reviews.llvm.org/D32525

Feb 28 2018, 8:51 AM
Typz updated the diff for D32525: [clang-format] Add SpaceBeforeColon option.

Address review comments.

Feb 28 2018, 8:33 AM
Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

The problem I have is really related to the current AlwaysBreakTemplateDeclarations behavior, which does not apply to functions.
I set it to false, and I get this:

Feb 28 2018, 7:29 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

Some initial design work has been done, and Krasimir said that he's interested. No timeline though :(

Feb 28 2018, 7:08 AM
Typz added a comment to D32525: [clang-format] Add SpaceBeforeColon option.

ping?

Feb 28 2018, 7:08 AM
Typz added a comment to D42684: clang-format: Allow optimizer to break template declaration..

Please given an explanation of what you are trying to achieve with this change. Do you intend to set the penalty high so that clang-format does other things first before falling back to wrapping template declarations?

Why treat separate declarations differently wrt. wrapping the template declarations? Will this stop at classes vs. functions? I generally have doubts that this option carries it's weight. Do you have a style guide that explicitly tells you to do this?

Feb 28 2018, 7:05 AM
Typz added a comment to D42729: clang-format: Fix formatting of function body followed by semicolon.
  • Of course you find all sorts of errors while testing clang-format on a large-enough codebase. That doesn't mean that users run into them much.
  • We have had about 10k clang-format users internally for several years. The semicolon issue comes up but really rarely and if it does, people happily fix their code not blaming clang-format.

    Unrelated, my point remains that setting BlockKind in TokenAnnotator is bad enough that I wouldn't want to do it for reaping this small benefit. And I can't see how you could easily achieve the same thing without doing that.
Feb 28 2018, 6:59 AM
Typz added a comment to D42787: clang-format: do not add extra indent when wrapping last parameter.

What I mean is, users will find it surprising if whether or not a parameter gets wrapped leads to a different indentation internal to that parameter. I have not heard of a single user that would be surprised by this extra indentation.

Feb 28 2018, 6:56 AM
Typz added a comment to D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch.

I don't agree that that's the same thing. The closing brace is still neatly aligned with the line of the opening brace (which happens to be just the opening brace).

Feb 28 2018, 6:52 AM
Typz added a comment to D43015: clang-format: Introduce BreakInheritanceList option.

ping?

Feb 28 2018, 6:52 AM

Feb 27 2018

Typz added inline comments to D43290: clang-format: tweak formatting of variable initialization blocks.
Feb 27 2018, 9:30 AM
Typz updated the diff for D43290: clang-format: tweak formatting of variable initialization blocks.

Prevent breaking between = and { when Cpp11BracedListStyle=false.

Feb 27 2018, 8:02 AM
Typz added a comment to D43290: clang-format: tweak formatting of variable initialization blocks.

Tweaking the penalty handling would still be needed in any case, since the problem happens also when Cpp11BracedListStyle is true (though the effect is more subtle)

I don't understand this. Which style do you actually care about? With Cpp11BracedListStyle=true or =false?

Feb 27 2018, 6:04 AM
Typz committed rC326192: clang-format: use AfterControlStatement to format ObjC control blocks.
clang-format: use AfterControlStatement to format ObjC control blocks
Feb 27 2018, 5:52 AM
Typz committed rC326191: clang-format: fix formatting of ObjC @synchronized blocks.
clang-format: fix formatting of ObjC @synchronized blocks
Feb 27 2018, 5:52 AM
Typz committed rL326192: clang-format: use AfterControlStatement to format ObjC control blocks.
clang-format: use AfterControlStatement to format ObjC control blocks
Feb 27 2018, 5:51 AM
Typz closed D43232: clang-format: use AfterControlStatement to format ObjC control blocks.
Feb 27 2018, 5:51 AM
Typz committed rL326191: clang-format: fix formatting of ObjC @synchronized blocks.
clang-format: fix formatting of ObjC @synchronized blocks
Feb 27 2018, 5:51 AM
Typz closed D43114: clang-format: fix formatting of ObjC @synchronized blocks.
Feb 27 2018, 5:51 AM

Feb 16 2018

Typz updated the diff for D43232: clang-format: use AfterControlStatement to format ObjC control blocks.

Fix bug which was lingering: prevent inlining of ObjC special control blocks.

Feb 16 2018, 9:07 AM

Feb 15 2018

Typz added inline comments to D43114: clang-format: fix formatting of ObjC @synchronized blocks.
Feb 15 2018, 9:12 AM