Page MenuHomePhabricator

darwin (Darwin Xu)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 20 2021, 10:54 PM (16 w, 6 d)

Recent Activity

Today

darwin updated the summary of D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.
Sat, Jun 19, 10:20 AM · Restricted Project, Restricted Project
darwin updated the diff for D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Updated with the fix code.

Sat, Jun 19, 10:07 AM · Restricted Project, Restricted Project

Tue, Jun 15

darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

I think we can agree its complicated, how about you take your unit tests and show us what the "code change" looks like to fix the bug

If that gets overly convoluted then perhaps we can bring the idea forward of a more generalised approach.

Tue, Jun 15, 12:58 AM · Restricted Project, Restricted Project

Sun, Jun 13

darwin retitled D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace from [clang-format] Fix the issue of no empty line after namespace to [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.
Sun, Jun 13, 10:25 AM · Restricted Project, Restricted Project
darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Going the full way, to fix the number of empty lines after/before/between elements would be real nice. But even nicer would be if you can state a range.

But I think all those proposed options should not be added in one go.

Sun, Jun 13, 7:26 AM · Restricted Project, Restricted Project
darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Do we need a set options for when we want to insert/retain/add a newline after various constructs? frankly I've been mulling over the concept of adding a

NewLinesBetweenFunctions: 1

I personally don't like code written like this as I find it hard to read, I'd like to be able to mandate a single line between functions

void foo()
{
...
}
void bar()
{
...
}
void foobar()
{
...
}

I prefer when its written as:

void foo()
{
...
}

void bar()
{
...
}

void foobar()
{
...
}

Maybe we even need a more generalised mechanism that would allow alot of flexibility letting people control their own specific style.

EmptyLineInsertionStyle: Custom
      AfterNameSpaceOpeningBrace: 1
      BeforeNameSpaceClosingBrace: 1
      BetweenFunctions: 2
      AfterClassOpeningBrace: 1
      BeforeClassClosingBrace: 1
      AfterAccessModifier : 1
      BeforeAccessModifier: 1
Sun, Jun 13, 6:21 AM · Restricted Project, Restricted Project

Fri, Jun 11

darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Devils advocate how is this any different from

class Foo {

class Bar {} ;
}

};

This would become

class Foo {
   class Bar {};
};

i.e. its going to remove the extra lines, just asking so we can understand if the removal of the line is the error or the fact it doesn't remove the line in the first place?

Fri, Jun 11, 9:54 AM · Restricted Project, Restricted Project
darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Just so I'm clear are you proposing that a newlines should always be added or that single blank lines should be ignored? I can't tell if the bug is that the line isn't being removed or sometimes not being added, either way there will be someone who wants it the other way around correct?

Fri, Jun 11, 2:30 AM · Restricted Project, Restricted Project

Thu, Jun 10

darwin updated the summary of D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.
Thu, Jun 10, 11:27 PM · Restricted Project, Restricted Project
darwin updated the summary of D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.
Thu, Jun 10, 10:14 PM · Restricted Project, Restricted Project
darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Sorry, I may need some help here. It shows "Context not available.", how do I correct it?

There are multiple ways: https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface
I use git diff HEAD~1 -U999999 > mypatch.patch

For your tests: You want to keep an empty line after the now wrapped {, did I understand that correctly?
Is that bound to the google style, i.e. does it not happen with LLVM style?

Thu, Jun 10, 10:07 PM · Restricted Project, Restricted Project
darwin added reviewers for D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace: HazardyKnusperkeks, curdeius, MyDeveloperDay, Restricted Project.
Thu, Jun 10, 10:03 AM · Restricted Project, Restricted Project
darwin added a comment to D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.

Sorry, I may need some help here. It shows "Context not available.", how do I correct it?

Thu, Jun 10, 9:51 AM · Restricted Project, Restricted Project
darwin changed the repository for D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace from rG LLVM Github Monorepo to rZORG LLVM Github Zorg.
Thu, Jun 10, 9:49 AM · Restricted Project, Restricted Project
darwin requested review of D104044: [clang-format] Fix the issue that empty lines being removed at the beginning of namespace.
Thu, Jun 10, 9:47 AM · Restricted Project, Restricted Project

Feb 25 2021

darwin added a comment to D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

Hi guys, thanks for accepting the change. But I don't have commit access of LLVM. Can someone commit it for me?

Can and will do. Need the name and email for the commit.

But I will wait a bit, if someone raises a concern.

Feb 25 2021, 6:50 PM · Restricted Project, Restricted Project

Feb 24 2021

darwin added a comment to D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

Hi guys, thanks for accepting the change. But I don't have commit access of LLVM. Can someone commit it for me?

Feb 24 2021, 2:25 AM · Restricted Project, Restricted Project

Feb 23 2021

darwin updated the diff for D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

Fix the code's alignment.

Feb 23 2021, 6:28 AM · Restricted Project, Restricted Project

Feb 22 2021

darwin added a comment to D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

You should mark comments as done, if they are.

Does your modification maybe add something to the alignment which is not a declaration?

int a;
double b;
a * b;

How is that formatted? Yeah unlikely that something like that is in code, but it could be if operator* has side effects and one does not need the result.

Feb 22 2021, 7:29 PM · Restricted Project, Restricted Project
darwin updated the diff for D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

Add more test cases.

Feb 22 2021, 8:28 AM · Restricted Project, Restricted Project

Feb 21 2021

darwin added inline comments to D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.
Feb 21 2021, 9:43 PM · Restricted Project, Restricted Project
darwin retitled D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers from Bug fix of https://bugs.llvm.org/show_bug.cgi?id=49175 to Bug fix of clang-format, the AlignConsecutiveDeclarations option doesn't handle pointer properly.
Feb 21 2021, 9:18 PM · Restricted Project, Restricted Project
darwin added a comment to D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.

Just out of curiosity, in which language is Const used?

Feb 21 2021, 9:14 PM · Restricted Project, Restricted Project

Feb 20 2021

darwin requested review of D97137: [clang-format] Fix AlignConsecutiveDeclarations handling of pointers.
Feb 20 2021, 11:48 PM · Restricted Project, Restricted Project