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)

Tracking

(Not tracked)

People

(Reporter: glandium, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached file Input (deleted) —
I'm going to attach the input and output (because tabs are involved, and copy/paste is not going to cut it)
Attached file Output (deleted) —
Attachment #8922153 - Attachment mime type: text/x-c++src → text/plain
Attachment #8922154 - Attachment mime type: text/x-c++src → text/plain
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.
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.
Priority: -- → P3
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)
Attached file output.cpp (deleted) —
clang-format version 5.0.0 (tags/RELEASE_500/final)
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.
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)
(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.
Product: Core → Firefox Build System
Component: Source Code Analysis → Lint and Formatting
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: