Re: [PATCH 1/4] editorconfig: set maximum line length to 120 characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Karthik Nayak <karthik.188@xxxxxxxxx> writes:
>
>> So my intent was to instead was to allow the user to be in charge of
>> line-wrapping, but for no reason should that go beyond 120 columns.
>>
>> I'm happy to change that to 80 columns, this does mean that supported
>> editors will start wrapping at 80 columns. Users will have to override
>> as necessary.
>
> OK.  So stepping back a bit
>
>  1. We advise people to avoid exceeding 80 columns
>
>  2. A line can be easier to read without wrapping strictly at 80
>     columns but left as a single line, slightly going above the
>     limit..
>
>  3. Even with the second observation above, a line that is way
>     longer than 80 columns is not acceptably long.
>
> Now, what is the line between the #2 and #3?  If we set these "hard
> limit" to that number, as long as the tool does not pack multiple
> shorter lines into one line using that number as a limit, we'd be at
> a happy place, I would imagine?
>

Spot on. Doing some backhand analysis on our code base:

Total lines: 2136626
Max length: 904
Average length: 36.2
Median length: 32.0
90th percentile: 73.0
95th percentile: 79.0

Lines > 80 chars: 91650 (4.3%)
Lines > 100 chars: 54589 (2.6%)
Lines > 120 chars: 35529 (1.7%)

The `max_line_length` in '.editorconfig' is stated as:

  Forces hard line wrapping after the amount of characters specified.
  unset to turn off this feature (use the editor settings).

So it doesn't force packing shorter lines together, rather, only wraps
lines above the specified limit. This limit can be thought of the limit
beyond which a line is of unacceptable length. We can move this lower to
perhaps 100 or even 80, but that would force line wrapping at 80
characters. Which can be great, but there are situations like you
mentioned where we want to extend.

> Thanks.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux