Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-2510

adjust checkstyle configurations to decrease violations

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: build
    • Labels:
      None

      Description

      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.

        Attachments

        1. update-pom-violations.bash
          1.0 kB
          Erik Weathers
        2. update-all-pom-violations.bash
          0.1 kB
          Erik Weathers

          Issue Links

            Activity

              People

              • Assignee:
                erikdw Erik Weathers
                Reporter:
                erikdw Erik Weathers
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m