[
https://issues.apache.org/jira/browse/STORM-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007805#comment-16007805
]
Erik Weathers edited comment on STORM-2510 at 5/12/17 9:44 AM:
---------------------------------------------------------------
I created the
[{{update-all-pom-violations.bash}}|https://issues.apache.org/jira/secure/attachment/12867732/update-all-pom-violations.bash]
script to allow easily updating the {{maxAllowedViolations}} for our modules
after we tweak checkstyle configurations. This script works by parsing each
module's {{checkstyle-result.xml}} file to find the number of violations, and
then updates the associated {{pom.xml}} file's {{maxAllowedViolations}} to be
that same number.
NOTE:
# You'll also need to download
[{{update-pom-violations.bash}}|https://issues.apache.org/jira/secure/attachment/12867725/update-pom-violations.bash]
to the root storm repo.
# You will likely need to set
[{{failOnViolations}}|https://github.com/apache/storm/blob/9755ff547de3247fe4aa1b60a778983145f43f76/pom.xml#L1102]
to {{false}} first in case your changes cause more violations, since that
would cause an early abort of the build and thus we wouldn't accumulate all of
the {{checkstyle-result.xml}} files needed for
{{update-all-pom-violations.bash}} to function.
was (Author: erikdw):
I created the
[{{update-all-pom-violations.bash}}|https://issues.apache.org/jira/secure/attachment/12867732/update-all-pom-violations.bash]
script to allow easily updating the {{maxAllowedViolations}} for our modules
after we tweak checkstyle configurations. This script works by parsing each
module's {{checkstyle-result.xml}} file to find the number of violations, and
then updates the associated {{pom.xml}} file's {{maxAllowedViolations}} to be
that same number.
NOTE:
# You'll also need to download
[{{update-pom-violations.bash}}|https://issues.apache.org/jira/secure/attachment/12867725/update-pom-violations.bash]
to the root storm repo.
# You will likely need to set
[{{failOnViolations}}|https://github.com/apache/storm/blob/9755ff547de3247fe4aa1b60a778983145f43f76/pom.xml#L1102]
to {{false}} first in case your changes cause more violations, since that
would cause an early abort of the build and thus we wouldn't accumulate all of
the {{checkstyle-result.xml}} files needed for {{update-pom-violations.bash}}
to function.
> adjust checkstyle configurations to decrease violations
> -------------------------------------------------------
>
> Key: STORM-2510
> URL: https://issues.apache.org/jira/browse/STORM-2510
> Project: Apache Storm
> Issue Type: Bug
> Components: build
> Affects Versions: 2.0.0
> Reporter: Erik Weathers
> Assignee: Erik Weathers
> Attachments: update-all-pom-violations.bash,
> update-pom-violations.bash
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Adjust Storm's checkstyle configuration:
> * 4-space indent instead of 2-space indent that is default with
> google_checks.xml
> ** More hand-written code in Storm is 4-space indented than 2-space indented.
> * exclude the thrift generated code from checkstyle
> ** since we shouldn't be touching it anyways
> * go with 120 character line-length limits instead of the default of 100 from
> google_checks.xml
> ** This cuts ~70% of the line-length violations. We might wanna increase it
> even more. 140 would cut out ~90% of the line-length violations.
> With those adjustments, the total number of violations will shrink by
> ~100,000 (~140,000 -> ~40,000).
> We can decrease the existing violations even more if we upgrade the
> checkstyle version from 6.11.2 to 7.7. I figured this out after noticing
> that IntelliJ had different (& fewer) violations when I ran the checkstyle
> plugin on the same module in IntelliJ as compared to with cmdline maven. A
> further benefit of the newer checkstyle version is that it runs *way* faster.
> As in ~6+ times faster.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)