Uploaded image for project: 'REEF (Retired)'
  1. REEF (Retired)
  2. REEF-332 Pass checkstyle
  3. REEF-358

Fix violations / reconfigure checkstyle checks in "Whitespace" category

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.12
    • All
    • None

    Description

      We have several errors per each of the checks in "Whitespace" category, so I'm creating one task for all of them.
      Here is the list of checks which are currently enabled in our checkstyle and have violations in the code, and my suggestions on how to fix them:

      1. MethodParamPad (prohibit whitespace between method/constructor name and left parenthesis of parameter list): our code has ~40 violations grouped in a few files, I suggest we fix violations and keep the check as is.
      2. WhitespaceAfter (enforce whitespace after comma and semicolon): our code has ~6 violations, I suggest we fix violations and keep the check as is.
      3. EmptyForIteratorPad (prohibit whitespace in empty for iterator): our code has 5 violations, personally I feel that the loops look better with whitespace so I suggest we change check configuration to enforce whitespace in empty for iterators.
      4. NoWhitespaceAfter (prohibit whitespace after certain types of tokens): our code has 1 violation,
        org/apache/reef/examples/group/bgd/data/parser/SVMLightParser.java
        new Object[] { examples.size(), avgFtLen, avgFtLen / examples.size() }

        This code looks fine as is, so I suggest to change configuration to ignore ARRAY_INIT tokens (i.e., allow whitespace after {).

      5. NoWhitespaceBefore (prohibit whitespace before ; ): our code has 4 violations:
        • 2 empty for-loops for ( ; ; )
        • standalone ; at org/apache/reef/io/storage/local/LocalStorageService.java line 43
        • ; at org/apache/reef/wake/profiler/WakeProfiler.java line 214
          I don't want to disable this check completely, but there's no way to disable it for empty for loops individually. For two last occurrences, I'd just fix the violations.

      Attachments

        Activity

          People

            MariiaMykhailova Mariia Mykhailova
            MariiaMykhailova Mariia Mykhailova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: