ci: fail checkstyle on all findings except warning.LOW (#4899)

develop
jdrueckert 2021-11-27 16:59:30 +00:00 committed by GitHub
parent 3769272d3e
commit 32761bff98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 21 deletions

20
Jenkinsfile vendored
View File

@ -28,7 +28,7 @@ properties([
* - Git Forensics Plugin (https://plugins.jenkins.io/git-forensics/)
* To compare code scans and static analysis against a reference build from the base branch.
* - JUnit Plugin (https://plugins.jenkins.io/junit/)
* To record the results of our test suites from JUnit format.
* To record the results of our test suites from JUnit format.
*
*/
@ -123,16 +123,24 @@ pipeline {
// this is wrong in our case, so explicitly set `develop` as default
// TODO: does this also work for PRs with different base branch?
discoverGitReferenceBuild(defaultBranch: 'develop')
recordIssues skipBlames: true, enabledForFailure: true,
recordIssues(skipBlames: true, enabledForFailure: true,
tool: checkStyle(pattern: '**/build/reports/checkstyle/*.xml'),
qualityGates: [
[threshold: 1, type: 'NEW_HIGH', unstable: false], // mark stage "failed" on new high findings
[threshold: 1, type: 'NEW_NORMAL', unstable: false], // mark stage "failed" on new normal findings
[threshold: 1, type: 'TOTAL_HIGH', unstable: true], // mark stage "unstable" on existing high findings
[threshold: 1, type: 'TOTAL_NORMAL', unstable: true] // mark stage "unstable" on existing normal findings
])
recordIssues(skipBlames: true, enabledForFailure: true,
tools: [
checkStyle(pattern: '**/build/reports/checkstyle/*.xml'),
spotBugs(pattern: '**/build/reports/spotbugs/main/*.xml', useRankAsPriority: true),
pmdParser(pattern: '**/build/reports/pmd/*.xml')
]
])
recordIssues skipBlames: true, enabledForFailure: true,
recordIssues(skipBlames: true, enabledForFailure: true,
tool: taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle', \
lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP')
lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP'))
}
}
}

View File

@ -7,7 +7,7 @@ import com.google.common.base.Objects;
import org.terasology.gestalt.entitysystem.component.Component;
public final class StringComponent implements Component<StringComponent>{
public final class StringComponent implements Component<StringComponent> {
public static String staticValue = "Test";
public String value;

View File

@ -13,21 +13,21 @@ public interface RenderSystem extends ComponentSystem {
/**
* Called with an OpenGL state useful to the rendering of opaque objects. See OpaqueObjectsNode for more information.
*/
default void renderOpaque() {};
default void renderOpaque() { };
/**
* Called with an OpenGL state useful to the rendering of alpha blended objects. See SimpleBlendMaterialsNode for more information.
*/
default void renderAlphaBlend() {};
default void renderAlphaBlend() { };
/**
* Called with an OpenGL state useful to the rendering of overlays. See OverlaysNode for more information.
*/
default void renderOverlay() {};
default void renderOverlay() { };
/**
* @deprecated Currently not used.
*/
@Deprecated
default void renderShadows() {};
default void renderShadows() { };
}

View File

@ -38,7 +38,7 @@ public final class LineRenderer {
* </a>
*/
public static void draw(float x1, float y1, float x2, float y2, float width, Colorc color, Colorc background, float alpha) {
if(lineMesh == null) {
if (lineMesh == null) {
lineMesh = Assets.generateAsset(lineMeshData, Mesh.class);
}
GL11.glDisable(GL11.GL_CULL_FACE);

View File

@ -23,7 +23,7 @@ import java.util.Objects;
/**
* Merging light in chunks
*/
public class LightMerger {
public final class LightMerger {
private static final int CENTER_INDEX = 13;
private static final int LOCAL_CHUNKS_SIDE_LENGTH = 3;
private static final int LOCAL_CHUNKS_ARRAY_LENGTH =

View File

@ -344,14 +344,21 @@ public final class Terasology implements Callable<Integer> {
* <p>
* On Windows, you may be able to set a limit using one of these external tools:
* <ul>
* <li><a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier">Application Verifier
* (<code>AppVerif.exe</code>)</a>, available from the Windows SDK</li>
* <li><a href="https://github.com/lowleveldesign/process-governor">Process Governor (<code>procgov</code>)</a>,
* an open source third-party tool
*
* <li>
* <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier">
* Application Verifier (<code>AppVerif.exe</code>)
* </a>
* , available from the Windows SDK
* </li>
* <li>
* <a href="https://github.com/lowleveldesign/process-governor">
* Process Governor (<code>procgov</code>)
* </a>
* , an open source third-party tool
* </li>
* </ul>
* @param bytes maximum allowed size
* @see <a href="https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE"
* >Java command-line options</a>
* @see <a href="https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE">Java command-line params</a>
* @see <a href="https://man7.org/linux/man-pages/man2/setrlimit.2.html">setrlimit(2)</a>
*/
private static void setMemoryLimit(long bytes) {

View File

@ -25,7 +25,7 @@ class DataSizeConverterTest {
"44040192, 42 m",
"268435456, 256M",
"2684354560, 2.5g",
"8589934592, 8G",
"8589934592, 8G"
})
void testValidInputs(long expected, String input) {
assertEquals(expected, new DataSizeConverter().convert(input));