Enforce max line length of 120 characters in Java files

Peter Palaga ppalaga at redhat.com
Wed Dec 17 08:29:18 UTC 2014


Hm..., as can be seen in my own commit that reduces lines to 120 chars, 
120 is still too much in GitHub's diff viewer: 
https://github.com/ppalaga/rhq-metrics/commit/b620d03e3e62cd8dfa9a26707577494654a7d643

That can make the reviewing on Github a little bit inconvenient. Is 
anybody seeing this as a valid reason for going with 100 chars? I am 
undecided.

-- P

On 2014-12-16 17:39, Jay Shaughnessy wrote:
>
> 120 is what we have been using for RHQ and I think is a good limit to
> enforce.  Well, not just enforce, lines that are too short should be
> extended by the auto-formatting.
>
> On 12/16/2014 11:19 AM, Peter Palaga wrote:
>> Hi *,
>>
>> this was discussed already to some extent on IRC. As it stands ATM, we
>> do not check the line length for any file type during Maven build.
>>
>> As the first step in this area, I propose to introduce the line length
>> limit of 120 chars for Java files. The value 120 is given by what
>> GitHub is able to display without horizontal scrollbar - see [1] and [2]
>>
>> The PR for rhq-checkstyle-config: [3]
>> The impact on rhq-metrics: [4]
>>
>> Are there any concerns about this?
>>
>> [1]
>> https://github.com/rhq-project/rhq-metrics/blob/b30bf59526774669f24d3a22a6c1da3edc1a5ae3/clients/ptranslator/src/main/java/org/rhq/metrics/clients/ptrans/MetricBatcher.java#L13
>>
>>
>> [2]
>> http://stackoverflow.com/questions/22207920/what-is-githubs-character-limit-or-line-length-for-viewing-files-on-github
>>
>>
>> [3] https://github.com/rhq-project/rhq-checkstyle-config/pull/4
>>
>> [4]
>> https://github.com/ppalaga/rhq-metrics/tree/141216-max-line-length-java
>>
>> Thanks,
>>
>> Peter
>> _______________________________________________
>> rhq-devel mailing list
>> rhq-devel at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
>
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel



More information about the rhq-devel mailing list