Update clang format rules

RESOLVED FIXED in Firefox 53

Status

Firefox Build System
Source Code Analysis
RESOLVED FIXED
2 years ago
3 months ago

People

(Reporter: sylvestre, Assigned: sylvestre)

Tracking

(Blocks: 1 bug)

Trunk
mozilla53

Firefox Tracking Flags

(firefox53 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

Comment hidden (empty)
Comment hidden (mozreview-request)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8810380 [details]
Bug 1317305 - Update clang format rules

https://reviewboard.mozilla.org/r/92734/#review92720

I didn't check to make sure that you weren't missing any MacroBlockBegin macros which I have used (because I can't do that very well off of the top of my head).

::: .clang-format:10
(Diff revision 1)
> +
> +# Force pointers to the type for C++.
> +DerivePointerAlignment: false
> +PointerAlignment: Left
> +
> +# Prevent the lost of indentation with these macros

the loss of indentation

::: .clang-format:11
(Diff revision 1)
> +# Force pointers to the type for C++.
> +DerivePointerAlignment: false
> +PointerAlignment: Left
> +
> +# Prevent the lost of indentation with these macros
> +MacroBlockBegin: "^(NS_INTERFACE_MAP_BEGIN|NS_INTERFACE_TABLE_HEAD|NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION|NS_IMPL_CYCLE_COLLECTION_.*_BEGIN|NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED|NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED|NS_INTERFACE_TABLE_BEGIN|NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED|NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED)$"

Is there any way we could lay this out nicer in this file? I'm not sure what file formats are supported but it would be neat if it could have one macro per line, like:

    NS_INTERFACE_MAP_BEGIN |
    NS_INTERFACE_TABLE_HEAD |
    NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION |
    ...
Attachment #8810380 - Flags: review?(michael) → review+
Comment hidden (mozreview-request)
(Assignee)

Comment 4

2 years ago
mozreview-review-reply
Comment on attachment 8810380 [details]
Bug 1317305 - Update clang format rules

https://reviewboard.mozilla.org/r/92734/#review92720

> Is there any way we could lay this out nicer in this file? I'm not sure what file formats are supported but it would be neat if it could have one macro per line, like:
> 
>     NS_INTERFACE_MAP_BEGIN |
>     NS_INTERFACE_TABLE_HEAD |
>     NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION |
>     ...

Great idea, I found the syntax in this bug https://llvm.org/bugs/show_bug.cgi?id=30656
and it is indeed much better!

Comment 5

2 years ago
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c4917d6cf776
Update clang format rules r=mystor

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c4917d6cf776
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox53: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
(Assignee)

Updated

a year ago
status-firefox52: affected → ---

Updated

3 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.