Typz (Francois Ferrand)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 25 2017, 12:43 AM (38 w, 1 d)

Recent Activity

Dec 18 2017

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

So you mean a solution like the one discussed earlier would be the way to go?

Dec 18 2017, 3:04 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Dec 18 2017, 1:09 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

ping?

Dec 18 2017, 1:09 AM

Dec 6 2017

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

Ok, that's probably where our different opinions come from - I would want a macro to be formatted to reflect how it's implemented, because otherwise I'm going to be surprised when I look at the implementation, and I consider surprises to be something to avoid in programming in general, where possible.

Dec 6 2017, 7:36 AM

Dec 5 2017

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

I don't think this is really relevant for this tool: if someone changes the implementation of the macro, then *they* must indeed if it should not be formatted like a namespace (and keep the clang-format configuration unchanged), or if it should now be formatted like a class (and thus make changes to clang-format configuration). Here we are not defining what the macro does, but how clang-format should indent it : in most case I don't think the indentation format should actually depend on the way it is implemented...

Dec 5 2017, 8:20 AM

Dec 1 2017

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

As far as "parsing" and formatting inside the block is concerned, this is indeed unrelated (and would totally work if all macros where specified with some preprocessor definitions).

Dec 1 2017, 7:20 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

Indeed, looks good, thanks!

Dec 1 2017, 7:16 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

Definitely that would be much more expressive. But this approach is also incomplete: in case of namespace (and possibly others?), we also need to perform the reverse operation, e.g. to "generate" a macro call for rewriting the closing comment.

Dec 1 2017, 6:00 AM
Typz abandoned D33589: clang-format: consider not splitting tokens in optimization.
Dec 1 2017, 5:50 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

I think the difference between code and comments is that code "words" are easily 10 characters or more, whereas actual words (in comments) are very often less than 10 characters: so code overflowing by 10 characters is not very frequent. whereas small words in comment will often get closer to the "extra" limit.

Dec 1 2017, 5:50 AM

Nov 23 2017

Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

@klimek wrote:
In the above example, we add 3 line breaks, and we'd add 1 (or more) additional line breaks when reflowing below the column limit.
I agree that that can lead to different overall outcomes, but I don't see how the approach of this patch really fixes it - it will only ever reflow below the column limit, so it'll also lead to states for long lines where reflowing and leaving chars over the line limit might be the overall best choice (unless I'm missing something)?

Nov 23 2017, 6:35 AM

Nov 21 2017

Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

Btw, another issue I am having is that reflowing does not respect the alignment. For exemple:

Nov 21 2017, 8:07 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

I think this patch doesn't handle a couple of cases that I'd like to see handled. A counter-proposal with different trade-offs is in D40068.

Nov 21 2017, 7:46 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

One interesting trade-off I'm running into:
My gut feeling is that we really want to make local decisions about whether we want to break/reflow - this makes the code significantly simpler (IMO), and handles all tests in this patch correctly, but is fundamentally limiting the global optimizations we can do. Specifically, we would not correctly reflow this:

//       |< limit
// foo bar
// baz
// x

to

// foo
// bar
// baz x

when the excess character limit is low.

Nov 21 2017, 7:41 AM
Typz added a comment to D40068: Implement more accurate penalty & trade-offs while breaking protruding tokens..

Generally, this indeed improves the situation (though I cannot say much about the code itself, it is still too subtle for my shallow knowledge of clang-format).

Nov 21 2017, 7:27 AM

Nov 20 2017

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

ping?

Nov 20 2017, 3:13 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Nov 20 2017, 3:11 AM

Nov 9 2017

Typz updated the diff for D33440: clang-format: better handle statement macros.

Address review comments

Nov 9 2017, 5:38 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

Out of curiosity, will this be able to fix the two situations that you get for python extension?
There, you usually have a PyObject_HEAD with out semicolon in a struct and than a PyObject_HEAD_INIT(..) in a braced init list. More info:
http://starship.python.net/crew/mwh/toext/node20.html

Nov 9 2017, 5:00 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

Unless I'm missing something, I'd agree with Daniel; this is not a rule that's widely used, and I'd say reformatting a code base to the clang-formatted variant will not regress readability.

Nov 9 2017, 4:36 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

Sorry for the long response time. I don't see this style rule expressed explicitly in the Skia or QtCreator style guides - is this something that just happens to be done sometimes in the code bases?

Nov 9 2017, 2:39 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

ping?

Nov 9 2017, 12:13 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Nov 9 2017, 12:13 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

ping ?

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

ping?

Nov 9 2017, 12:13 AM

Oct 24 2017

Typz updated the diff for D37813: clang-format: better handle namespace macros.

rebase

Oct 24 2017, 9:24 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

rebase

Oct 24 2017, 9:24 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

ping?

Oct 24 2017, 9:16 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

My question is: if CanBreak is false, we currently don't call breakProtrudingToken. So either we do something very wrong in that case (which might be true, but I'd like to understand why) or we should be able to just calculate the penalty by not breaking anything and go on.

Oct 24 2017, 9:16 AM
Typz added a comment to D37813: clang-format: better handle namespace macros.

I think instead of introducing more and more special cases of macros we might want to handle, we should instead allow specifying macro productions globally.

Oct 24 2017, 8:57 AM

Sep 20 2017

Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

This cannot be implemented where we currently call breakProtrudingToken(), since this function starts by 'creating' the BreakableToken and dealing with meany corner cases: so this should be done before in any case.
But the code at the end of breakProtrudingToken() is actually very similar to what you propose.

Sep 20 2017, 1:03 AM

Sep 19 2017

Typz updated the diff for D33589: clang-format: consider not splitting tokens in optimization.

Remove Reflow from LineState, and perform the decision again during reconstruction phase.

Sep 19 2017, 6:06 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

I am still trying to get to the bottom of this assertion, any hint where to look for?

Sep 19 2017, 5:50 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

I think doing the computation twice is fine. Or at least, I'd need a test case where it actually shows substantial overhead before doing what you are doing here. Understand that creating more States and making the State object itself larger also has cost and that cost occurs in the combinatorial exploration of the solution space. Doing an additional computation at the end should be comparatively cheap. Look at it this way: During the exploration of the solution space, we might enter breakProtrudingToken many times for the same comment. One more time during reconstruction of the solution is not that harmful.

Sep 19 2017, 5:37 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

For one thing, we need to update the state to store the "decision" of the reflowing mode, which is performed only in DryRun=true mode, to avoid doing the computation multiple times.

Sep 19 2017, 4:57 AM
Typz updated the diff for D37813: clang-format: better handle namespace macros.

rebase

Sep 19 2017, 1:09 AM
Typz added inline comments to D33440: clang-format: better handle statement macros.
Sep 19 2017, 1:04 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Add tests.
Replace sorted list with hashtable.

Sep 19 2017, 1:03 AM

Sep 13 2017

Typz added a reviewer for D37813: clang-format: better handle namespace macros: klimek.
Sep 13 2017, 9:30 AM
Typz retitled D33440: clang-format: better handle statement macros from clang-format: better handle statement and namespace macros to clang-format: better handle statement macros.
Sep 13 2017, 9:29 AM
Typz created D37813: clang-format: better handle namespace macros.
Sep 13 2017, 9:28 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Split diff: handle only statements in here, namespace macros will be moved to another one.

Sep 13 2017, 9:23 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Fix review comments, before splitting the commit.

Sep 13 2017, 8:58 AM
Typz added inline comments to D33440: clang-format: better handle statement macros.
Sep 13 2017, 8:49 AM
Typz updated the diff for D33589: clang-format: consider not splitting tokens in optimization.

Reorder the functions to minimize diff.

Sep 13 2017, 8:28 AM
Typz added inline comments to D33589: clang-format: consider not splitting tokens in optimization.
Sep 13 2017, 7:50 AM
Typz accepted D37795: SplitEmptyFunction should be true in the Mozilla coding style.
Sep 13 2017, 7:33 AM

Sep 12 2017

Typz updated the diff for D33440: clang-format: better handle statement macros.

Rebase to master to fix merge issue

Sep 12 2017, 2:05 AM

Sep 11 2017

Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

ping?

Sep 11 2017, 8:35 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Sep 11 2017, 8:35 AM
Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

ping?

Sep 11 2017, 8:35 AM

Jul 28 2017

Typz updated the diff for D33589: clang-format: consider not splitting tokens in optimization.

Rebase

Jul 28 2017, 7:16 AM
Typz committed rL309370: clang-format: merge short case labels with trailing comments.
clang-format: merge short case labels with trailing comments
Jul 28 2017, 12:57 AM
Typz closed D35557: clang-format: merge short case labels with trailing comments by committing rL309370: clang-format: merge short case labels with trailing comments.
Jul 28 2017, 12:57 AM
Typz committed rL309369: clang-format: fix block OpeningLineIndex around preprocessor.
clang-format: fix block OpeningLineIndex around preprocessor
Jul 28 2017, 12:57 AM
Typz closed D35483: clang-format: fix block OpeningLineIndex around preprocessor by committing rL309369: clang-format: fix block OpeningLineIndex around preprocessor.
Jul 28 2017, 12:56 AM

Jul 24 2017

Typz added inline comments to D35483: clang-format: fix block OpeningLineIndex around preprocessor.
Jul 24 2017, 5:42 AM

Jul 23 2017

Typz updated the diff for D35483: clang-format: fix block OpeningLineIndex around preprocessor.

Address review commentsx

Jul 23 2017, 2:33 PM
Typz added inline comments to D35557: clang-format: merge short case labels with trailing comments.
Jul 23 2017, 2:31 PM
Typz updated the diff for D35557: clang-format: merge short case labels with trailing comments.

Address review comments

Jul 23 2017, 2:31 PM

Jul 18 2017

Typz added a comment to D33440: clang-format: better handle statement macros.

t>>! In D33440#812645, @djasper wrote:

So, there are two things in this patch: Statement macros and namespace macros. Lets break this out and handle them individually. They really aren't related that much.

Jul 18 2017, 6:18 AM
Typz created D35557: clang-format: merge short case labels with trailing comments.
Jul 18 2017, 5:53 AM
Typz updated the diff for D35483: clang-format: fix block OpeningLineIndex around preprocessor.

Add more tests

Jul 18 2017, 1:40 AM

Jul 17 2017

Typz created D35483: clang-format: fix block OpeningLineIndex around preprocessor.
Jul 17 2017, 6:36 AM

Jul 13 2017

Typz updated the diff for D33589: clang-format: consider not splitting tokens in optimization.

Move code out of optimizer, directly into ContinuationIndenter::breakProtrudingToken(), to minimize impact on performance.
Comment reflowing of breakable items which break the limit will be slightly slower, since we now consider the two options; however this change has no impact on the performance of processing non-breakable items, and may actually increase the operformance of processing breakable items which do not need to be reflowed.

Jul 13 2017, 9:30 AM
Typz added inline comments to D33589: clang-format: consider not splitting tokens in optimization.
Jul 13 2017, 6:30 AM
Typz added inline comments to D33589: clang-format: consider not splitting tokens in optimization.
Jul 13 2017, 5:17 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Jul 13 2017, 2:25 AM

Jul 12 2017

Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

I renamed the option to AlignAfterOperator, is it acceptable now?
(I also thought of UnindentOperator, but I think it is better to keep the notion of alignment)

Jul 12 2017, 9:33 AM
Typz updated the diff for D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

Rename option to AlignAfterOperator

Jul 12 2017, 8:17 AM

Jul 4 2017

Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

ping?

Jul 4 2017, 1:33 AM
Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Jul 4 2017, 1:24 AM

Jun 30 2017

Typz committed rL306874: clang-format: add options to merge empty record body.
clang-format: add options to merge empty record body
Jun 30 2017, 1:26 PM
Typz closed D34395: clang-format: add options to merge empty record body by committing rL306874: clang-format: add options to merge empty record body.
Jun 30 2017, 1:26 PM
Typz committed rL306868: clang-format: Do not binpack initialization lists.
clang-format: Do not binpack initialization lists
Jun 30 2017, 1:00 PM
Typz closed D34238: clang-format: Do not binpack initialization lists by committing rL306868: clang-format: Do not binpack initialization lists.
Jun 30 2017, 1:00 PM

Jun 29 2017

Typz added inline comments to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.
Jun 29 2017, 6:07 AM

Jun 28 2017

Typz added a comment to D33440: clang-format: better handle statement macros.

ping?

Jun 28 2017, 3:09 AM

Jun 26 2017

Typz updated the diff for D34395: clang-format: add options to merge empty record body.

Merge SplitEmptyClass/Struct/Union options into a single SplitEmptyRecord option.

Jun 26 2017, 6:33 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Fix typo

Jun 26 2017, 6:18 AM
Typz updated the summary of D33440: clang-format: better handle statement macros.
Jun 26 2017, 6:18 AM
Typz retitled D33440: clang-format: better handle statement macros from clang-format: properly handle Q_UNUSED and QT_REQUIRE_VERSION to clang-format: better handle statement and namespace macros.
Jun 26 2017, 6:18 AM
Typz updated the diff for D33440: clang-format: better handle statement macros.

Complete refactor to make the processing much more generic

Jun 26 2017, 6:15 AM
Typz added a comment to D34395: clang-format: add options to merge empty record body.

I don't know if some style would want different styles, and I agree with you on principle; but since the brace wrapping is already configured for each kind of record, I choose to keep things consistent and have flags for each kind of record.
But I can merge the options, and keep only SplitEmptyRecord and SplitEmptyNamespace, if you really think it is better.

Jun 26 2017, 1:28 AM

Jun 23 2017

Typz added a comment to D33589: clang-format: consider not splitting tokens in optimization.

why do we want to make an exception for comments and not for regular code?

Jun 23 2017, 8:49 AM
Typz added a comment to D34395: clang-format: add options to merge empty record body.

ping?

Jun 23 2017, 5:59 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

ping?

Jun 23 2017, 5:58 AM
Typz added a comment to D34238: clang-format: Do not binpack initialization lists.

ping?

Jun 23 2017, 5:58 AM

Jun 21 2017

Typz committed rL305912: clang-format: introduce InlineOnly short function style.
clang-format: introduce InlineOnly short function style
Jun 21 2017, 6:56 AM
Typz closed D34399: clang-format: introduce InlineOnly short function style by committing rL305912: clang-format: introduce InlineOnly short function style.
Jun 21 2017, 6:56 AM
Typz updated the diff for D34399: clang-format: introduce InlineOnly short function style.

Fix according to review comments

Jun 21 2017, 5:02 AM
Typz added inline comments to D34399: clang-format: introduce InlineOnly short function style.
Jun 21 2017, 4:52 AM

Jun 20 2017

Typz updated the diff for D34395: clang-format: add options to merge empty record body.

Enable merging records for Mozilla style

Jun 20 2017, 6:43 AM
Typz updated the diff for D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

Rebase & fix indentation when newline is inserted after return or equal.

Jun 20 2017, 6:11 AM
Typz added a comment to D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set.

This style is used in the Skia project.

Jun 20 2017, 6:10 AM
Typz created D34399: clang-format: introduce InlineOnly short function style.
Jun 20 2017, 5:52 AM
Typz created D34395: clang-format: add options to merge empty record body.
Jun 20 2017, 4:45 AM

Jun 19 2017

Typz updated the diff for D34238: clang-format: Do not binpack initialization lists.

Fix indentation

Jun 19 2017, 9:04 AM
Typz updated the diff for D34238: clang-format: Do not binpack initialization lists.

Fix case where the content fits on a line, by wrapping after each comma, like this:

Jun 19 2017, 8:51 AM
Typz committed rL305696: clang-format: Fix C99 designated initializers corner cases.
clang-format: Fix C99 designated initializers corner cases
Jun 19 2017, 7:42 AM