[clang-format] ? operator incorrectly indented by two spaces

NEW
Unassigned

Status

2 years ago
7 months ago

People

(Reporter: jya, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Per Mozilla coding style:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Operators

operators are to be indented on the next line at the beginning (see bug 1338105)

This is also the case for the unary (?) operator.
"This applies to ?:"

As such it should be written as:
  LOGV("%d audio samples demuxed (sid:%d)",
       aSamples->mSamples.Length(),
       aSamples->mSamples[0]->mTrackInfo
       ? aSamples->mSamples[0]->mTrackInfo->GetID()
       : 0);

However, clang-format always indent by two characters the ? operator and it's written as:

  LOGV("%d audio samples demuxed (sid:%d)",
       aSamples->mSamples.Length(),
       aSamples->mSamples[0]->mTrackInfo
         ? aSamples->mSamples[0]->mTrackInfo->GetID()
         : 0);

which is incorrect.

Updated

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