Skip to content

Commit

Permalink
minor: fixed formatting for input files
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and romani committed Dec 8, 2022
1 parent c725b21 commit 1262afe
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 146 deletions.
Expand Up @@ -45,10 +45,10 @@ public void testValidateRequiredParameter()

final String[] expected = {
"6:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"33:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"66:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"87:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"114:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"34:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"68:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"90:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
"118:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "firstParameter"),
};

verify(checkConfig, getPath("InputRequiredParameterForAnnotationCheck.java"), expected);
Expand All @@ -68,27 +68,27 @@ public void testMultipleProperties1()
"6:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter, thirdParameter"),
"10:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"18:4: " + getCheckMessage(MSG_KEY,
"19:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "secondParameter, thirdParameter"),
"33:4: " + getCheckMessage(MSG_KEY,
"34:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter, thirdParameter"),
"38:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"48:4: " + getCheckMessage(MSG_KEY,
"39:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"50:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "secondParameter, thirdParameter"),
"66:4: " + getCheckMessage(MSG_KEY,
"68:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter, thirdParameter"),
"69:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"75:4: " + getCheckMessage(MSG_KEY,
"71:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"78:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "secondParameter, thirdParameter"),
"87:4: " + getCheckMessage(MSG_KEY,
"90:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter, thirdParameter"),
"91:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"99:4: " + getCheckMessage(MSG_KEY,
"94:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"103:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "secondParameter, thirdParameter"),
"114:4: " + getCheckMessage(MSG_KEY,
"118:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter, thirdParameter"),
"118:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"126:4: " + getCheckMessage(MSG_KEY,
"122:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "thirdParameter"),
"131:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "secondParameter, thirdParameter"),
};
verify(checkConfig, getPath("InputRequiredParameterForAnnotationCheck.java"), expected);
Expand All @@ -106,19 +106,19 @@ public void testMultipleProperties2()
final String[] expected = {
"6:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter"),
"18:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"33:4: " + getCheckMessage(MSG_KEY,
"19:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"34:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter"),
"48:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"66:4: " + getCheckMessage(MSG_KEY,
"50:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"68:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter"),
"75:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"87:4: " + getCheckMessage(MSG_KEY,
"78:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"90:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter"),
"99:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"114:4: " + getCheckMessage(MSG_KEY,
"103:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"118:4: " + getCheckMessage(MSG_KEY,
"testAnnotation1", "firstParameter, secondParameter"),
"126:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
"131:4: " + getCheckMessage(MSG_KEY, "testAnnotation1", "secondParameter"),
};
verify(checkConfig, getPath("InputRequiredParameterForAnnotationCheck.java"), expected);
}
Expand All @@ -134,19 +134,19 @@ public void testForAnnotationWithCanonicalName()
checkConfig.addProperty("requiredParameters", "par1");

final String[] expected = {
"27:4: " + getCheckMessage(MSG_KEY,
"28:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1"),
"59:4: " + getCheckMessage(MSG_KEY,
"61:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1"),
"82:4: " + getCheckMessage(MSG_KEY,
"85:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1"),
"108:4: " + getCheckMessage(MSG_KEY,
"112:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1"),
"135:4: " + getCheckMessage(MSG_KEY,
"140:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1"),
};
Expand All @@ -164,19 +164,19 @@ public void testMultipleParametersForAnnotationWithCanonicalName()
checkConfig.addProperty("requiredParameters", "par1,par2");

final String[] expected = {
"27:4: " + getCheckMessage(MSG_KEY,
"28:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1, par2"),
"59:4: " + getCheckMessage(MSG_KEY,
"61:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1, par2"),
"82:4: " + getCheckMessage(MSG_KEY,
"85:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1, par2"),
"108:4: " + getCheckMessage(MSG_KEY,
"112:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1, par2"),
"135:4: " + getCheckMessage(MSG_KEY,
"140:4: " + getCheckMessage(MSG_KEY,
"com.github.sevntu.checkstyle.checks.annotation"
+ ".InputRequiredParameterForAnnotationCheck.testAnnotation2", "par1, par2"),
};
Expand Down
Expand Up @@ -62,10 +62,10 @@ public final void test() throws Exception {
"129:13: " + getCheckMessage(MSG_KEY, "e"),
"142:13: " + getCheckMessage(MSG_KEY, "e"),
"152:13: " + getCheckMessage(MSG_KEY, "e"),
"197:13: " + getCheckMessage(MSG_KEY, "fakeException"),
"216:13: " + getCheckMessage(MSG_KEY, "e"),
"221:13: " + getCheckMessage(MSG_KEY, "e"),
"226:13: " + getCheckMessage(MSG_KEY, "e"),
"198:13: " + getCheckMessage(MSG_KEY, "fakeException"),
"217:13: " + getCheckMessage(MSG_KEY, "e"),
"222:13: " + getCheckMessage(MSG_KEY, "e"),
"227:13: " + getCheckMessage(MSG_KEY, "e"),
};

verify(checkConfig, getPath("InputAvoidHidingCauseExceptionCheck.java"), expected);
Expand Down
Expand Up @@ -55,8 +55,8 @@ public void testFinal() throws Exception {
final String[] expected = {
"19:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"20:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"24:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"29:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"25:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"30:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -78,10 +78,10 @@ public void testPackagePrivate() throws Exception {
checkConfig.addProperty("forbiddenClassesRegexpPublic", null);

final String[] expected = {
"23:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
"24:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
"25:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand Down Expand Up @@ -127,8 +127,8 @@ public void testProtectedAndTransient() throws Exception {
checkConfig.addProperty("forbiddenClassesRegexpPublic", null);

final String[] expected = {
"21:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "protected"),
"21:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "transient"),
"22:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "protected"),
"22:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "transient"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -151,8 +151,8 @@ public void testPublicAndVolatile() throws Exception {
"InputAvoidModifiersForTypesCheck");

final String[] expected = {
"22:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "public"),
"22:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "volatile"),
"23:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "public"),
"23:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "volatile"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -177,12 +177,12 @@ public void testFinalAndPrivatePackage() throws Exception {
final String[] expected = {
"19:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"20:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"23:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
"24:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"24:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
"29:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"25:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck",
"package-private"),
"25:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"30:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -208,8 +208,8 @@ public void testFinalAndStatic() throws Exception {
"19:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"20:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"20:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "static"),
"24:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"29:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"25:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
"30:9: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "final"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -231,7 +231,7 @@ public void testProtected() throws Exception {
checkConfig.addProperty("forbiddenClassesRegexpPublic", null);

final String[] expected = {
"21:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "protected"),
"22:5: " + getCheckMessage(MSG_KEY, "InputAvoidModifiersForTypesCheck", "protected"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand All @@ -252,9 +252,9 @@ public void testLogger() throws Exception {
checkConfig.addProperty("forbiddenClassesRegexpPublic", "Logger");

final String[] expected = {
"36:9: " + getCheckMessage(MSG_KEY, "Logger", "protected"),
"37:9: " + getCheckMessage(MSG_KEY, "Logger", "public"),
"38:9: " + getCheckMessage(MSG_KEY, "Logger", "package-private"),
"37:9: " + getCheckMessage(MSG_KEY, "Logger", "protected"),
"38:9: " + getCheckMessage(MSG_KEY, "Logger", "public"),
"39:9: " + getCheckMessage(MSG_KEY, "Logger", "package-private"),
};

verify(checkConfig, getPath("InputAvoidModifiersForTypesCheck.java"), expected);
Expand Down
Expand Up @@ -43,10 +43,10 @@ public void testDefault() throws Exception {
"28:50: " + getCheckMessage(MSG_KEY),
"29:41: " + getCheckMessage(MSG_KEY),
"59:40: " + getCheckMessage(MSG_KEY),
"60:83: " + getCheckMessage(MSG_KEY),
"79:48: " + getCheckMessage(MSG_KEY),
"92:78: " + getCheckMessage(MSG_KEY),
"93:68: " + getCheckMessage(MSG_KEY),
"61:32: " + getCheckMessage(MSG_KEY),
"80:48: " + getCheckMessage(MSG_KEY),
"95:32: " + getCheckMessage(MSG_KEY),
"96:68: " + getCheckMessage(MSG_KEY),
};
verify(checkConfig,
getPath("InputDiamondOperatorForVariableDefinitionCheck.java"), expected);
Expand Down
Expand Up @@ -85,7 +85,7 @@ public void testNormalWork2() throws Exception {
"com.github.sevntu.checkstyle.checks.coding.InputForbidInstantiationCheck");

final String[] expected = {
"12:89: " + getCheckMessage(MSG_KEY, "InputForbidInstantiationCheck"),
"13:15: " + getCheckMessage(MSG_KEY, "InputForbidInstantiationCheck"),
};

verify(checkConfig, getPath("InputForbidInstantiationCheckWithoutDots.java"), expected);
Expand All @@ -98,8 +98,8 @@ public void testNormalWork3() throws Exception {
checkConfig.addProperty("forbiddenClasses", "java.io.File , java.lang.String , ");

final String[] expected = {
"13:22: " + getCheckMessage(MSG_KEY, "File"),
"14:20: " + getCheckMessage(MSG_KEY, "String"),
"14:22: " + getCheckMessage(MSG_KEY, "File"),
"15:20: " + getCheckMessage(MSG_KEY, "String"),
};

verify(checkConfig, getPath("InputForbidInstantiationCheckWithoutDots.java"), expected);
Expand Down
Expand Up @@ -65,10 +65,10 @@ public final void sameNameExceptionsTest() throws Exception {
final String[] expected = {
"12:15: " + getCheckMessage(MSG_KEY),
"23:13: " + getCheckMessage(MSG_KEY),
"66:9: " + getCheckMessage(MSG_KEY),
"88:9: " + getCheckMessage(MSG_KEY),
"107:9: " + getCheckMessage(MSG_KEY),
"127:9: " + getCheckMessage(MSG_KEY),
"68:9: " + getCheckMessage(MSG_KEY),
"92:9: " + getCheckMessage(MSG_KEY),
"112:9: " + getCheckMessage(MSG_KEY),
"133:9: " + getCheckMessage(MSG_KEY),
};

verify(checkConfig,
Expand Down
Expand Up @@ -259,7 +259,7 @@ public final void testSerializableWarning() throws Exception {
checkConfig.addProperty("matchMethodsByArgCount", "true");

final String[] expected = {
"31:20: " + getCheckMessage(MSG_KEY, "doSmth", READ_OBJECT_KEY),
"32:20: " + getCheckMessage(MSG_KEY, "doSmth", READ_OBJECT_KEY),
};

verify(checkConfig, getPath("InputOverridableMethodInConstructorCheck11.java"), expected);
Expand Down
Expand Up @@ -139,7 +139,7 @@ public void testAssertjSupport() throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(RequireFailForTryCatchInJunitCheck.class);
final String[] expected = {
"80:9: " + getCheckMessage(MSG_KEY),
"81:9: " + getCheckMessage(MSG_KEY),
};
verify(checkConfig, getPath("InputRequireFailForTryCatchInJunitCheck10.java"), expected);
}
Expand Down
Expand Up @@ -40,7 +40,7 @@ public void testDefaultConfigProhibitsExceptionsWithoutParams() throws Exception
final DefaultConfiguration defaultConfig =
createModuleConfig(ConstructorWithoutParamsCheck.class);
final String[] expectedViolationMsg = {
"35:37: " + getCheckMessage(MSG_KEY, "RuntimeException"),
"36:37: " + getCheckMessage(MSG_KEY, "RuntimeException"),
};
verify(defaultConfig, getPath("InputConstructorWithoutParamsCheck.java"),
expectedViolationMsg);
Expand All @@ -53,8 +53,8 @@ public void testUserDefinedConfigProhibitsCustomClasses() throws Exception {
defaultConfig.addProperty("classNameFormat", "Clazz[1-9]");
defaultConfig.addProperty("ignoredClassNameFormat", "Clazz4");
final String[] expectedViolationMsg = {
"69:27: " + getCheckMessage(MSG_KEY, "Clazz1"),
"72:27: " + getCheckMessage(MSG_KEY, "Clazz2"),
"71:27: " + getCheckMessage(MSG_KEY, "Clazz1"),
"74:27: " + getCheckMessage(MSG_KEY, "Clazz2"),
};
verify(defaultConfig, getPath("InputConstructorWithoutParamsCheck.java"),
expectedViolationMsg);
Expand Down

0 comments on commit 1262afe

Please sign in to comment.