Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
checkstyle.xml: enforce line wrap indentation of 8 spaces (#1025)
Browse files Browse the repository at this point in the history
checkstyle.xml: Enforce line wrap indentation of 8 spaces

Let's update the checkstyle.xml file to enforce the indentation
of wrapped lines to be 8 spaces, as required by our coding
standard.
  • Loading branch information
jamessspanggg committed Dec 11, 2020
1 parent 6071829 commit c147662
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions config/checkstyle/checkstyle.xml
Expand Up @@ -344,6 +344,7 @@

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

<module name="NoWhitespaceBefore">
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/seedu/address/commons/util/StringUtilTest.java
Expand Up @@ -62,13 +62,13 @@ public void containsWordIgnoreCase_nullWord_throwsNullPointerException() {
@Test
public void containsWordIgnoreCase_emptyWord_throwsIllegalArgumentException() {
assertThrows(IllegalArgumentException.class, "Word parameter cannot be empty", ()
-> StringUtil.containsWordIgnoreCase("typical sentence", " "));
-> StringUtil.containsWordIgnoreCase("typical sentence", " "));
}

@Test
public void containsWordIgnoreCase_multipleWords_throwsIllegalArgumentException() {
assertThrows(IllegalArgumentException.class, "Word parameter should be a single word", ()
-> StringUtil.containsWordIgnoreCase("typical sentence", "aaa BBB"));
-> StringUtil.containsWordIgnoreCase("typical sentence", "aaa BBB"));
}

@Test
Expand Down Expand Up @@ -132,7 +132,7 @@ public void containsWordIgnoreCase_validInputs_correctResult() {
@Test
public void getDetails_exceptionGiven() {
assertTrue(StringUtil.getDetails(new FileNotFoundException("file not found"))
.contains("java.io.FileNotFoundException: file not found"));
.contains("java.io.FileNotFoundException: file not found"));
}

@Test
Expand Down
Expand Up @@ -127,7 +127,7 @@ public void parseCommand_undoCommandWord_returnsUndoCommand() throws Exception {
@Test
public void parseCommand_unrecognisedInput_throwsParseException() {
assertThrows(ParseException.class, String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE), ()
-> parser.parseCommand(""));
-> parser.parseCommand(""));
}

@Test
Expand Down
Expand Up @@ -44,7 +44,7 @@ public void parseIndex_invalidInput_throwsParseException() {
@Test
public void parseIndex_outOfRangeInput_throwsParseException() {
assertThrows(ParseException.class, MESSAGE_INVALID_INDEX, ()
-> ParserUtil.parseIndex(Long.toString(Integer.MAX_VALUE + 1)));
-> ParserUtil.parseIndex(Long.toString(Integer.MAX_VALUE + 1)));
}

@Test
Expand Down
Expand Up @@ -165,6 +165,6 @@ public void setPersons_listWithDuplicatePersons_throwsDuplicatePersonException()
@Test
public void asUnmodifiableObservableList_modifyList_throwsUnsupportedOperationException() {
assertThrows(UnsupportedOperationException.class, ()
-> uniquePersonList.asUnmodifiableObservableList().remove(0));
-> uniquePersonList.asUnmodifiableObservableList().remove(0));
}
}
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/testutil/PersonUtil.java
Expand Up @@ -35,7 +35,7 @@ public static String getPersonDetails(Person person) {
sb.append(PREFIX_EMAIL + person.getEmail().value + " ");
sb.append(PREFIX_ADDRESS + person.getAddress().value + " ");
person.getTags().stream().forEach(
s -> sb.append(PREFIX_TAG + s.tagName + " ")
s -> sb.append(PREFIX_TAG + s.tagName + " ")
);
return sb.toString();
}
Expand Down

0 comments on commit c147662

Please sign in to comment.