Open
Bug 1405914
Opened 7 years ago
Updated 2 years ago
clang-format: Bad restyle of a struct literal
Categories
(Developer Infrastructure :: Lint and Formatting, defect, P3)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox58 affected)
NEW
Tracking | Status | |
---|---|---|
firefox58 | --- | affected |
People
(Reporter: n.nethercote, Unassigned)
References
Details
clang-format just did this:
> -static const mozilla::Module kPrefModule = {
> - mozilla::Module::kVersion,
> - kPrefCIDs,
> - kPrefContracts,
> - nullptr,
> - nullptr,
> - nullptr,
> - UnloadPrefsModule
> -};
> +static const mozilla::Module kPrefModule = { mozilla::Module::kVersion,
> + kPrefCIDs,
> + kPrefContracts,
> + nullptr,
> + nullptr,
> + nullptr,
> + UnloadPrefsModule };
Pretty gross. It would be nice if that could be avoided.
Updated•7 years ago
|
Priority: -- → P3
Comment 1•7 years ago
|
||
This is the expected behavior since we use flag |BAS_Align| that according to the clang-format documentation:
>> /// \brief Align parameters on the open bracket, e.g.:
>> /// \code
>> /// someLongFunction(argument1,
>> /// argument2);
>> /// \endcode
>> BAS_Align,
Also I've looked other our coding style page to see why we use that flag and It seems the explanation can be found here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Methods
However I didn't find where the behavior that you mention is documented, and I don't think that implementing such a patch would be accepted up-stream since it envelopes treating a very particular scenario that doesn't have a wider application.
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•6 years ago
|
Blocks: clang-format
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
•