Closed Bug 1559193 Opened 6 years ago Closed 6 years ago

[Automated review][objective-c] clang-format wants to make lines longer than 80 chars

Categories

(Developer Infrastructure :: Source Code Analysis, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jfkthame, Unassigned)

Details

The clang-format patch proposed at https://phabricator.services.mozilla.com/D33796#1001108 wants to re-wrap lines such that they'll have a length that considerably exceeds 80 chars -- the longest one ends up around 100 chars.

Do we intentionally use an entirely different max line length in .mm files, or what's the basis for this?

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sledru)

Interesting finding. thanks!

The Google coding style for objective C says 100 chars:
http://google.github.io/styleguide/objcguide.html#line-length

which is what is implemented in clang-format:
https://github.com/llvm-mirror/clang/blob/master/lib/Format/Format.cpp#L885

We can force change that if we want.

Ehsan, what do you think?

Flags: needinfo?(sledru) → needinfo?(ehsan)
Priority: -- → P2

(In reply to Sylvestre Ledru [:sylvestre] from comment #2)

Interesting finding. thanks!

The Google coding style for objective C says 100 chars:
http://google.github.io/styleguide/objcguide.html#line-length

Yep.

which is what is implemented in clang-format:
https://github.com/llvm-mirror/clang/blob/master/lib/Format/Format.cpp#L885

We can force change that if we want.

Ehsan, what do you think?

My inclination is to follow the default Google style here unless if there is a great reason to change things (CCing Markus for visibility so that he can voice his opinion.)

FWIW since the switch to formatting with clang-format, a number of people have approached me asking if we're open to increasing our column limit to 100 lines globally now that we can reformat the tree automatically. I've been meaning to delve into some of the past objections to this to see what the arguments against doing so were at the time but have yet to find the time to do so... Not that this discussion should block what we do here, just wanted to point out that there is a desire on behalf of some folks to increase to 100 character column limit globally, FWIW.

Flags: needinfo?(ehsan)

I'm very happy about the fact that .mm files use 100 columns rather than 80 columns. Objective C conventions encourage rather verbose method names.
(Independently, I'm one of the people who would prefer a 100 column limit globally.)

ok, thanks.
I updated the doc: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style$compare?locale=en-US&to=1562111&from=1561421
So, this bug can be marked as invalid.

I would be also in favor of moving to 100 for C/C++. I can probably help with that project Ehsan.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Summary: [Automated review] clang-format wants to make lines longer than 80 chars → [Automated review][objective-c] clang-format wants to make lines longer than 80 chars

Great! I'll try to get in touch soon. :-)

Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.