All users were logged out of Bugzilla on October 13th, 2018

Fix wrong && and || operators indentation

RESOLVED FIXED in Firefox 57

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: jya, Assigned: jya)

Tracking

(Blocks: 1 bug)

Trunk
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
Over the year, we had changed the formatting of logical expression containing || and && to go from:

if (a &&
    b)

to:
if (a
    && b)

this stemmed from a misreading of the coding style:
"Overlong expressions not joined by && and || should break so the operator starts on the second line and starts in the same column as the start of the expression in the first line. This applies to ?:, binary arithmetic operators including +, and member-of operators (in particular the . operator in JavaScript, see the Rationale)."

*not* joined by && and || is the keypard.

So all are to be broken with the operator put at the front, except && and ||
(Assignee)

Updated

a year ago
See Also: → bug 1338105
I think we should run `mach clang-format` before landing a patch even if it is not 100% compatible with the Gecko coding style. Btw, what is clang-format's opinion about the position of && or ||?
Blocks: 1188202
Comment hidden (mozreview-request)

Comment 3

a year ago
mozreview-review
Comment on attachment 8904194 [details]
Bug 1396515: Fix incorrect && and || operator placements.

https://reviewboard.mozilla.org/r/175956/#review181170
Attachment #8904194 - Flags: review?(sledru) → review+

Comment 4

a year ago
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c884cca7be4a
Fix incorrect && and || operator placements. r=sylvestre
https://hg.mozilla.org/mozilla-central/rev/c884cca7be4a
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.