Skip to content

Commit

Permalink
Bump Checkstyle version to latest (opensearch-project#767)
Browse files Browse the repository at this point in the history
* Bump checkstyle version and fix violations

Signed-off-by: Chen Dai <daichen@amazon.com>

* Fix checkstyle violations in test code

Signed-off-by: Chen Dai <daichen@amazon.com>

Signed-off-by: Chen Dai <daichen@amazon.com>
  • Loading branch information
dai-chen authored Aug 17, 2022
1 parent ce15448 commit 8103d9f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ jacocoTestCoverageVerification {
check.dependsOn jacocoTestCoverageVerification

// TODO: fix code style in main and test source code
subprojects {
allprojects {
apply plugin: 'checkstyle'
checkstyle {
configFile rootProject.file("config/checkstyle/google_checks.xml")
toolVersion "8.29"
toolVersion "10.3.2"
configProperties = [
"org.checkstyle.google.suppressionfilter.config": rootProject.file("config/checkstyle/suppressions.xml")]
ignoreFailures = false
Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/google_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,11 @@ public void kmeanns_relation() {
public void ad_batchRCF_relation() {
Map<String, Literal> argumentMap =
new HashMap<String, Literal>() {{
put("shingle_size", new Literal(8, DataType.INTEGER));
}};
put("shingle_size", new Literal(8, DataType.INTEGER));
}};
assertAnalyzeEqual(
new LogicalAD(LogicalPlanDSL.relation("schema"), argumentMap),
new AD(AstDSL.relation("schema"), argumentMap)
new LogicalAD(LogicalPlanDSL.relation("schema"), argumentMap),
new AD(AstDSL.relation("schema"), argumentMap)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void testAbstractPlanNodeVisitorShouldReturnNull() {
put("shingle_size", new Literal(8, DataType.INTEGER));
put("time_decay", new Literal(0.0001, DataType.DOUBLE));
put("time_field", new Literal(null, DataType.STRING));
}
});
}
});
assertNull(ad.accept(new LogicalPlanNodeVisitor<Integer, Object>() {
}, null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public ExpressionScript(Expression expression) {
* Evaluate on the doc generate by the doc provider.
* @param docProvider doc provider.
* @param evaluator evaluator
* @return
* @return expr value
*/
public ExprValue execute(Supplier<Map<String, ScriptDocValues<?>>> docProvider,
BiFunction<Expression,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,13 @@ public void testVisitMlCommons() {
MLCommonsOperator mlCommonsOperator =
new MLCommonsOperator(
values(emptyList()), "kmeans",
new HashMap<String, Literal>() {{
put("centroids", new Literal(3, DataType.INTEGER));
put("iterations", new Literal(2, DataType.INTEGER));
put("distance_type", new Literal(null, DataType.STRING));
}
}, nodeClient);
new HashMap<String, Literal>() {{
put("centroids", new Literal(3, DataType.INTEGER));
put("iterations", new Literal(2, DataType.INTEGER));
put("distance_type", new Literal(null, DataType.STRING));
}},
nodeClient
);

assertEquals(executionProtector.doProtect(mlCommonsOperator),
executionProtector.visitMLCommons(mlCommonsOperator, null));
Expand All @@ -279,13 +280,14 @@ public void testVisitAD() {
NodeClient nodeClient = mock(NodeClient.class);
ADOperator adOperator =
new ADOperator(
values(emptyList()),
new HashMap<String, Literal>() {{
put("shingle_size", new Literal(8, DataType.INTEGER));
put("time_decay", new Literal(0.0001, DataType.DOUBLE));
put("time_field", new Literal(null, DataType.STRING));
}
}, nodeClient);
values(emptyList()),
new HashMap<String, Literal>() {{
put("shingle_size", new Literal(8, DataType.INTEGER));
put("time_decay", new Literal(0.0001, DataType.DOUBLE));
put("time_field", new Literal(null, DataType.STRING));
}},
nodeClient
);

assertEquals(executionProtector.doProtect(adOperator),
executionProtector.visitAD(adOperator, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum Format {
private final String formatName;

private static final Map<String, Format> ALL_FORMATS;

static {
ImmutableMap.Builder<String, Format> builder = new ImmutableMap.Builder<>();
for (Format format : Format.values()) {
Expand Down

0 comments on commit 8103d9f

Please sign in to comment.