On 18/02/2020 19:04, Gary Gregory wrote:
- Avoid bikeshedding for what should be in these above files by picking
Commons Lang's versions of these files.

I've finished the PR for collections with the new checkstyle based on lang's configuration with a few additions:

1. I added a check for the Apache licence header. There were quite a lot of files with different header formatting. rat check is fine with this but checkstyle requires an exact match. I've just corrected all the broken headers (probably about 5% of the source files).

2. I added an indentation check. There were nearly 1000 issues here.

I did not use an auto-formatting tool to avoid mangling human readable layout. Checkstyle is fine with indents that are greater than 4 spaces. There are a few occasions where human readable layout wrapped to 3 spaces and checkstyle complained:

StringBuffer buf = ...
buf.append(this)
   .append(that) ...

I've not bothered here with checkstyle exclusions. I just wrapped to 4 characters instead.

The indentation rule checks case statement indents. The code was using either 0 or 4 for the indent. Oracle recommend 0. Violations were lower with 0 as the indent so I went with that.


I've had a once over through all the diffs using the GitHub PR view. Most diffs are quite small. Some cases of incorrect indents over entire classes are harder to review. I'll look again later with fresh eyes. It would be good for a second review. There are a lot of changes.

There are more whitespace rules that could be added to checkstyle. But for now I think that more changes just make the PR harder to review.

The PR forces checkstyle:check in the default build executed on travis and checks both main and test sources. It should prevent code formatting creep over time.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to