build(checkstyle): update to version 10.2, update .idea to match (#5027)

This commit is contained in:
Kevin Turner 2022-06-04 08:04:46 -07:00 committed by GitHub
parent f4d3d5da01
commit 114f175778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 36 additions and 26 deletions

View File

@ -3,12 +3,12 @@
<component name="CheckStyle-IDEA"> <component name="CheckStyle-IDEA">
<option name="configuration"> <option name="configuration">
<map> <map>
<entry key="active-configuration" value="PROJECT_RELATIVE:$PROJECT_DIR$/config/metrics/checkstyle/checkstyle.xml:Terasology" /> <entry key="active-configuration-0" value="PROJECT_RELATIVE:$PROJECT_DIR$/config/metrics/checkstyle/checkstyle.xml:Terasology;All" />
<entry key="checkstyle-version" value="8.45" /> <entry key="checkstyle-version" value="10.2" />
<entry key="copy-libs" value="false" /> <entry key="copy-libs" value="false" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" /> <entry key="location-0" value="BUNDLED:(bundled):Sun Checks;All" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" /> <entry key="location-1" value="BUNDLED:(bundled):Google Checks;All" />
<entry key="location-2" value="PROJECT_RELATIVE:$PROJECT_DIR$/config/metrics/checkstyle/checkstyle.xml:Terasology" /> <entry key="location-2" value="PROJECT_RELATIVE:$PROJECT_DIR$/config/metrics/checkstyle/checkstyle.xml:Terasology;All" />
<entry key="property-2.samedir" value="$PROJECT_DIR$/config/metrics/checkstyle" /> <entry key="property-2.samedir" value="$PROJECT_DIR$/config/metrics/checkstyle" />
<entry key="scan-before-checkin" value="true" /> <entry key="scan-before-checkin" value="true" />
<entry key="scanscope" value="AllSourcesWithTests" /> <entry key="scanscope" value="AllSourcesWithTests" />

8
.idea/findbugs-idea.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="FindBugs-IDEA">
<excludeFilterFiles>
<filter file="$PROJECT_DIR$/config/metrics/findbugs/findbugs-exclude.xml" enabled="true" />
</excludeFilterFiles>
</component>
</project>

View File

@ -42,6 +42,8 @@ tasks.withType<Test> {
configure<CheckstyleExtension> { configure<CheckstyleExtension> {
isIgnoreFailures = false isIgnoreFailures = false
toolVersion = "10.2"
val checkstyleDir = rootDir.resolve("config/metrics/checkstyle") val checkstyleDir = rootDir.resolve("config/metrics/checkstyle")
configDirectory.set(checkstyleDir) configDirectory.set(checkstyleDir)
setConfigProperties("samedir" to checkstyleDir) setConfigProperties("samedir" to checkstyleDir)

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation; package org.terasology.documentation;
@ -6,9 +6,9 @@ import com.google.common.collect.Multimaps;
import com.google.common.collect.SortedSetMultimap; import com.google.common.collect.SortedSetMultimap;
import org.terasology.engine.core.module.ExternalApiWhitelist; import org.terasology.engine.core.module.ExternalApiWhitelist;
import org.terasology.engine.core.module.ModuleManager; import org.terasology.engine.core.module.ModuleManager;
import org.terasology.engine.testUtil.ModuleManagerFactory;
import org.terasology.gestalt.module.ModuleEnvironment; import org.terasology.gestalt.module.ModuleEnvironment;
import org.terasology.gestalt.module.sandbox.API; import org.terasology.gestalt.module.sandbox.API;
import org.terasology.engine.testUtil.ModuleManagerFactory;
import java.net.URL; import java.net.URL;
import java.util.HashMap; import java.util.HashMap;
@ -95,9 +95,9 @@ public final class ApiScraper {
} }
} }
sortedApi.putAll("external", ExternalApiWhitelist.CLASSES.stream() sortedApi.putAll("external", ExternalApiWhitelist.CLASSES.stream()
.map(clazz->clazz.getName() + " (CLASS)").collect(Collectors.toSet())); .map(clazz -> clazz.getName() + " (CLASS)").collect(Collectors.toSet()));
sortedApi.putAll("external", ExternalApiWhitelist.PACKAGES.stream() sortedApi.putAll("external", ExternalApiWhitelist.PACKAGES.stream()
.map(packagee->packagee + " (PACKAGE)").collect(Collectors.toSet())); .map(packagee -> packagee + " (PACKAGE)").collect(Collectors.toSet()));
System.out.println("# Modding API:\n"); System.out.println("# Modding API:\n");
for (String key : sortedApi.keySet()) { for (String key : sortedApi.keySet()) {

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation.apiScraper; package org.terasology.documentation.apiScraper;
@ -8,9 +8,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.terasology.engine.core.module.ExternalApiWhitelist; import org.terasology.engine.core.module.ExternalApiWhitelist;
import org.terasology.engine.core.module.ModuleManager; import org.terasology.engine.core.module.ModuleManager;
import org.terasology.engine.testUtil.ModuleManagerFactory;
import org.terasology.gestalt.module.ModuleEnvironment; import org.terasology.gestalt.module.ModuleEnvironment;
import org.terasology.gestalt.module.sandbox.API; import org.terasology.gestalt.module.sandbox.API;
import org.terasology.engine.testUtil.ModuleManagerFactory;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -101,9 +101,9 @@ final class CompleteApiScraper {
} }
} }
api.putAll(EXTERNAL, ExternalApiWhitelist.CLASSES.stream() api.putAll(EXTERNAL, ExternalApiWhitelist.CLASSES.stream()
.map(clazz->clazz.getName() + " (CLASS)").collect(Collectors.toSet())); .map(clazz -> clazz.getName() + " (CLASS)").collect(Collectors.toSet()));
api.putAll(EXTERNAL, ExternalApiWhitelist.PACKAGES.stream() api.putAll(EXTERNAL, ExternalApiWhitelist.PACKAGES.stream()
.map(packagee->packagee + " (PACKAGE)").collect(Collectors.toSet())); .map(packagee -> packagee + " (PACKAGE)").collect(Collectors.toSet()));
//Puts the information in the StringBuffer //Puts the information in the StringBuffer
StringBuffer stringApi = new StringBuffer(); StringBuffer stringApi = new StringBuffer();

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.world.generation.facets; package org.terasology.engine.world.generation.facets;
@ -46,7 +46,7 @@ public abstract class BooleanFacetTest {
@Test @Test
public void testRelBounds() { public void testRelBounds() {
Assertions.assertThrows(IllegalArgumentException.class, Assertions.assertThrows(IllegalArgumentException.class,
()->facet.set(-15, -15, -15, true)); ()-> facet.set(-15, -15, -15, true));
} }
@Test @Test

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.math; package org.terasology.math;
@ -80,7 +80,7 @@ public class IntegerRangeTest {
validateRange(range, Integer.MAX_VALUE - 3, Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1, Integer.MAX_VALUE); validateRange(range, Integer.MAX_VALUE - 3, Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1, Integer.MAX_VALUE);
} }
private void validateRange(IntegerRange range, Integer...numbers) { private void validateRange(IntegerRange range, Integer... numbers) {
Iterator<Integer> iterator = range.iterator(); Iterator<Integer> iterator = range.iterator();
for (Integer number : numbers) { for (Integer number : numbers) {
assertTrue(iterator.hasNext()); assertTrue(iterator.hasNext());

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.rendering.dag; package org.terasology.engine.rendering.dag;
@ -11,11 +11,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.terasology.engine.context.Context; import org.terasology.engine.context.Context;
import org.terasology.engine.core.SimpleUri; import org.terasology.engine.core.SimpleUri;
import org.terasology.engine.rendering.ShaderManager;
import org.terasology.engine.rendering.dag.dependencyConnections.BufferPairConnection; import org.terasology.engine.rendering.dag.dependencyConnections.BufferPairConnection;
import org.terasology.engine.rendering.dag.dependencyConnections.DependencyConnection; import org.terasology.engine.rendering.dag.dependencyConnections.DependencyConnection;
import org.terasology.engine.rendering.dag.dependencyConnections.FboConnection; import org.terasology.engine.rendering.dag.dependencyConnections.FboConnection;
import org.terasology.gestalt.naming.Name; import org.terasology.gestalt.naming.Name;
import org.terasology.engine.rendering.ShaderManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -71,8 +71,8 @@ public class RenderGraph {
public void replaceNode(Node aNode, Node byNode) { public void replaceNode(Node aNode, Node byNode) {
// Add connections from a node being replaced; This should in theory be sufficient and once we call setDep over // Add connections from a node being replaced; This should in theory be sufficient and once we call setDep over
// all new nodes again, everything should be set // all new nodes again, everything should be set
aNode.getInputConnections().forEach((k, v)->byNode.getInputConnections().replace(k, v)); aNode.getInputConnections().forEach((k, v)-> byNode.getInputConnections().replace(k, v));
aNode.getOutputConnections().forEach((k, v)->byNode.getOutputConnections().replace(k, v)); aNode.getOutputConnections().forEach((k, v)-> byNode.getOutputConnections().replace(k, v));
nodeMap.replace(aNode.getUri(), byNode); nodeMap.replace(aNode.getUri(), byNode);
akaNodeMap.replace(aNode.getAka(), byNode); akaNodeMap.replace(aNode.getAka(), byNode);
@ -224,7 +224,7 @@ public class RenderGraph {
throw new RuntimeException("Cycle detected in the DAG: topological sorting not possible!"); throw new RuntimeException("Cycle detected in the DAG: topological sorting not possible!");
} }
topologicalList.forEach((key)->key.postInit(context)); topologicalList.forEach((key)-> key.postInit(context));
return topologicalList; return topologicalList;
} }

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.rendering.dag.dependencyConnections; package org.terasology.engine.rendering.dag.dependencyConnections;
@ -105,7 +105,7 @@ public abstract class DependencyConnection<T> {
* Remove connections * Remove connections
*/ */
public void disconnect() { public void disconnect() {
this.connectedConnections.forEach((k, v)->v.connectedConnections.remove(this.getName())); this.connectedConnections.forEach((k, v) -> v.connectedConnections.remove(this.getName()));
this.connectedConnections.clear(); this.connectedConnections.clear();
if (this.connectionType == Type.INPUT) { if (this.connectionType == Type.INPUT) {
this.data = null; this.data = null;

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation // Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.rendering.nui.widgets.browser.ui; package org.terasology.engine.rendering.nui.widgets.browser.ui;
@ -43,7 +43,7 @@ public interface ParagraphRenderable {
void renderContents(Canvas canvas, Vector2i startPos, ContainerRenderSpace containerRenderSpace, int leftIndent, int rightIndent, void renderContents(Canvas canvas, Vector2i startPos, ContainerRenderSpace containerRenderSpace, int leftIndent, int rightIndent,
ParagraphRenderStyle defaultStyle, HorizontalAlign horizontalAlign, HyperlinkRegister hyperlinkRegister); ParagraphRenderStyle defaultStyle, HorizontalAlign horizontalAlign, HyperlinkRegister hyperlinkRegister);
public interface HyperlinkRegister { interface HyperlinkRegister {
void registerHyperlink(Rectanglei region, String hyperlink); void registerHyperlink(Rectanglei region, String hyperlink);
} }
} }