Open
Bug 1411807
Opened 7 years ago
Updated 2 years ago
mach clang-format doesn't handle long /* */ comments properly
Categories
(Developer Infrastructure :: Lint and Formatting, defect, P3)
Developer Infrastructure
Lint and Formatting
Tracking
(Not tracked)
NEW
People
(Reporter: glandium, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
I'm going to attach the input and output (because tabs are involved, and copy/paste is not going to cut it)
Reporter | ||
Comment 1•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
Attachment #8922153 -
Attachment mime type: text/x-c++src → text/plain
Reporter | ||
Updated•7 years ago
|
Attachment #8922154 -
Attachment mime type: text/x-c++src → text/plain
Reporter | ||
Comment 2•7 years ago
|
||
Note the alignment is off in the input, but even making it right in the input doesn't help. The most surprising thing is that it makes the lines *after* the comment badly indented as well.
Reporter | ||
Comment 3•7 years ago
|
||
Ah, no, the bad alignment of the extra lines is because of unbalanced parentheses. But the comment problem is still there, and I've observed it on other code.
Updated•7 years ago
|
Blocks: clang-format
Updated•7 years ago
|
Priority: -- → P3
Comment 4•7 years ago
|
||
What version of clang-format did you use and how did you run it? I'm using:
>>clang-format version 5.0.0 (tags/RELEASE_500/final)
And the output format looks like the attached one, which I consider to be as expected.
Flags: needinfo?(mh+mozilla)
Comment 5•7 years ago
|
||
clang-format version 5.0.0 (tags/RELEASE_500/final)
Comment 6•7 years ago
|
||
I have another suggestion did you try to specify the coding style when you use clang-format, like:
>> clang-format -style=Mozilla
If you are using it from mach I think i might know what's the issue, it's related with .clang-format and these two lines:
[1] https://dxr.mozilla.org/mozilla-central/source/.clang-format#4
[2] https://dxr.mozilla.org/mozilla-central/source/.clang-format#37
I think we should remove these two since they no longer apply to the current status of re-flowing comments.
Reporter | ||
Comment 7•7 years ago
|
||
As noted in the bug title, I'm using mach clang-format. Although, even without mach, as long as the file is in the gecko tree, .clang-format is used.
Flags: needinfo?(mh+mozilla)
Comment 8•7 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #7)
> As noted in the bug title, I'm using mach clang-format. Although, even
> without mach, as long as the file is in the gecko tree, .clang-format is
> used.
Thanks for confirming this, the issue is because of those two options the .clang-format, that I strongly believe i should be removed.
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•6 years ago
|
Component: Source Code Analysis → Lint and Formatting
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•