Update Checkstyle rules

Issue #108 resolved
Matthias Schoettle created an issue

Following the discussions on our mailing list and in the comments of issue #86, we should adjust some of the rules:

  • Right Curly Placement: change to "same line" (more compact space for many else ifs when it is on the same line)
  • Missing Switch Default: disable (in our case usually the default case is to do nothing, which would lead to many empty default statements)
  • Visibility Modifier: check "protectedAllowed" (it's a big debate about strict encapsulation, but a compromise between encapsulation and cleaner/less code can be achieved if we allow it. Regardless, protected fields need to have a javadoc comment, which helps "users" to see their intention).

Comments (9)

  1. Matthias Schoettle reporter
    • changed status to open

    Update the rules to the following:

    • Allow to mention undeclared runtime exceptions in javadoc for the Method Javadoc rule
    • Allow to disable Checkstyle through comments completely
  2. Matthias Schoettle reporter

    Resolved issue #108 again: Added rules as per request.

    To disable checkstyle completely use:

    To disable temporarily: // CHECKSTYLE:OFF <reason>

    To enable it again: // CHECKSTYLE:ON

    → <<cset c60a53636ded>>

  3. Matthias Schoettle reporter

    References issue #108: Changed severity of "Magic Number" rule to info. There is no one solution to do this.

    This way, it is not considered a problem, but it can help a developer identify potential refactoring cases where it makes sense to create a constant.

    → <<cset 291056480eb9>>

  4. Matthias Schoettle reporter

    References issue #108: Changed severity of "Magic Number" rule to info. There is no one solution to do this.

    This way, it is not considered a problem, but it can help a developer identify potential refactoring cases where it makes sense to create a constant.

    (previous commit contained wrong changes)

    → <<cset 1578fa5d8f75>>

  5. Matthias Schoettle reporter

    References #108: Changes the AbstractClassName rule to ignore the name of classes, i.e., abstract classes that don't start with "Abstract" are not a problem anymore.

    → <<cset 0605285ca721>>

  6. Log in to comment