GitHub user mureinik opened a pull request:
https://github.com/apache/commons-lang/pull/254
Add checkstyle to the CI
The Apache Commons Lang project uses checktyle to enforce its coding style,
but this is only done as part of the reporting phase, when the site is
generated. Thus, using checkstyle becomes somewhat of an opt-in procedure,
depending on the vigilance of the developers to check the report, instead of
being an actual enforcement against violating the codestyle, as evident by the
fact that the current checkstyle report contains several hundred(!) such
violations.
This PR contains a series of patches to fix the existing checkstyle
violations and a final patch that adds checkstyle to Travis CI, making it a
gating check instead of an opt-in practice.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mureinik/commons-lang checkstyle
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/254.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #254
----
commit 13ebd5a955787ca91990a713c8cdf482aa72ca2a
Author: Allon Mureinik <[email protected]>
Date: 2017-03-05T10:05:23Z
Apply JavaDoc checkstyle only to public methods
The defacto style of the project requires Javadoc for public methods
only, but the checkstyle Javadoc check defaults to requiring them even
for private methods, generating 46 errors.
This patch sets the checkstyle Javadoc check's scope to public to clean
up the checkstyle report so it can be enabled in the CI.
If we wish to reset the check to a laxer scope, the aforementioned
errors should be fixed first.
commit c1c21cd9a7d1888f054813a50ab6c6a3b0517292
Author: Allon Mureinik <[email protected]>
Date: 2017-03-11T07:52:41Z
Remove unused SystemUtils import from ExceptionUtils
commit e14660f1c86acf8c2432593d9ad1a51108c2e83c
Author: Allon Mureinik <[email protected]>
Date: 2017-03-11T07:54:27Z
Replace tabs with spaces in DateUtils
commit a7d7e37d091bf1ba3674c6fc617466b284aaac71
Author: Allon Mureinik <[email protected]>
Date: 2017-03-11T08:13:44Z
Upgrade maven-checkstyle-plugin to 2.17
This patch upgrades maven-checkstyle-plugin to the latest available
version, 2.17.
This is done in order to consume a fix for checkstyle wrongfully
reporting an error if the @return javadoc tag was used in an
annotation type, as it is in Guarded (line 36).
Note that checkstyle has removed the RedundantThrows check (see
discussion at https://github.com/checkstyle/checkstyle/issues/473),
so it was removed from the project's checkstyle.xml configuration.
commit c407e34e7ecfde0e72bbbed1e5e8106792140d64
Author: Allon Mureinik <[email protected]>
Date: 2017-03-11T08:49:22Z
org.apache.commons.lang3.concurrent.annotation package-info
Added package-info.java to the
org.apache.commons.lang3.concurrent.annotation package to solve a
checkstyle violation.
commit 063e538595897a481f93d0a926a09081777eae4a
Author: Allon Mureinik <[email protected]>
Date: 2017-03-11T09:14:16Z
Add checkstyle to Travis CI
Currently, checkstyle is only run as part of the reporting phase, and
it's up to the developer to check the report manually.
This patch adds the checkstyle configuration to the build plugins so
it can be used to check the code (as opposed to just generate a
report of the failures) and adds it to Travis CI's configuration so
every new patch will be automatically checked against it.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---