Skip to content

Commit

Permalink
Update Checkstyle checks
Browse files Browse the repository at this point in the history
Lets update checkstyle rules as follows, and update the code to match.

New rules:
* To match SE-EDU Java Coding Standard (basic):
  1. DefaultComesLast
  2. NoWhitespaceBeforeCaseDefaultColon
  3. AtclauseOrder
  4. JavadocBlockTagLocation
  5. JavadocContentLocationCheck
  6. JavadocMissingLeadingAsterisk
  7. JavadocMissingWhitespaceAfterAsterisk
* To match SE-EDU Java Coding Standard (intermediate):
  1. MethodParamPad
  2. MissingJavadocType
* To match Google's Java Code Style:
  1. JavadocTagContinuationIndentation

Updates to existing rules:
1. Update default throwsIndent value for the Indentation
   from 4 (incorrect) to 8 (correct).

Updates to code to match the above:
1. HelpWindow file: to match JavadocTagContinuationIndentation
  • Loading branch information
yhtMinceraft1010X authored and damithc committed Jul 19, 2022
1 parent a7c730f commit a464dde
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
30 changes: 30 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@
-->
<module name ="DeclarationOrder"/>

<!-- Checks that default is after all cases in a switch statement -->
<module name="DefaultComesLast"/>

<module name="ModifierOrder">
<!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
8.4.3. The prescribed order is:
Expand Down Expand Up @@ -340,6 +343,7 @@

<module name="Indentation">
<property name="caseIndent" value="0" />
<property name="throwsIndent" value="8" />
</module>

<module name="NoWhitespaceBefore">
Expand All @@ -348,6 +352,11 @@
<property name="allowLineBreaks" value="true"/>
</module>

<module name="NoWhitespaceBeforeCaseDefaultColon"/>

<!-- Checks that there is no whitespace between method/constructor name and open parenthesis. -->
<module name="MethodParamPad"/>

<module name="ParenPad">
<!-- Checks that there is no whitespace before close parenthesis or after open parenthesis. -->
<property name="severity" value="warning"/>
Expand Down Expand Up @@ -376,6 +385,24 @@
JAVADOC CHECKS
-->

<!-- Checks that all block-tags are ordered correctly. -->
<module name="AtclauseOrder"/>

<!-- Checks that Javadoc block tags appear only at the beginning of the line. -->
<module name="JavadocBlockTagLocation"/>

<!-- Checks that all Javadoc comments start from the second line. -->
<module name="JavadocContentLocationCheck" />

<!-- Checks that each line in Javadoc has leading asterisks. -->
<module name="JavadocMissingLeadingAsterisk"/>

<!-- Checks that each non-empty line in Javadoc has whitespace after leading asterisk. -->
<module name="JavadocMissingWhitespaceAfterAsterisk"/>

<!-- Checks that for block tags, indentation of continuation lines is at least 4 spaces. -->
<module name="JavadocTagContinuationIndentation"/>

<!-- Checks the Javadoc's format for every class, enumeration and interface. -->
<module name="JavadocType">
<property name="allowMissingParamTags" value="true"/>
Expand All @@ -400,5 +427,8 @@
<property name="ignoreMethodNamesRegex" value="(set.*|get.*)"/>
</module>

<!-- Checks that every public class, enumeration and interface has a header comment. -->
<module name="MissingJavadocType"/>

</module>
</module>
28 changes: 14 additions & 14 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ public HelpWindow() {
/**
* Shows the help window.
* @throws IllegalStateException
* <ul>
* <li>
* if this method is called on a thread other than the JavaFX Application Thread.
* </li>
* <li>
* if this method is called during animation or layout processing.
* </li>
* <li>
* if this method is called on the primary stage.
* </li>
* <li>
* if {@code dialogStage} is already showing.
* </li>
* </ul>
* <ul>
* <li>
* if this method is called on a thread other than the JavaFX Application Thread.
* </li>
* <li>
* if this method is called during animation or layout processing.
* </li>
* <li>
* if this method is called on the primary stage.
* </li>
* <li>
* if {@code dialogStage} is already showing.
* </li>
* </ul>
*/
public void show() {
logger.fine("Showing help page about the application.");
Expand Down

0 comments on commit a464dde

Please sign in to comment.