Skip to content

Commit b50809c

Browse files
authored
feat: set checkstyle max warnings 0 by default (#218)
1 parent 1d3a0dd commit b50809c

File tree

6 files changed

+48
-15
lines changed

6 files changed

+48
-15
lines changed

DEPENDENCIES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ maven/mavencentral/com.google.j2objc/j2objc-annotations/1.1, Apache-2.0, approve
3939
maven/mavencentral/com.google.j2objc/j2objc-annotations/1.3, Apache-2.0, approved, CQ21195
4040
maven/mavencentral/com.google.j2objc/j2objc-annotations/2.8, Apache-2.0, approved, clearlydefined
4141
maven/mavencentral/com.googlecode.libphonenumber/libphonenumber/8.0.0, Apache-2.0, approved, clearlydefined
42-
maven/mavencentral/com.puppycrawl.tools/checkstyle/10.12.3, LGPL-2.1+, restricted, clearlydefined
42+
maven/mavencentral/com.puppycrawl.tools/checkstyle/10.12.3, LGPL-2.1-only AND Apache-2.0 AND LGPL-2.1-or-later AND ANTLR-PD AND GPL-2.0-or-later AND LGPL-2.0-or-later AND (Apache-2.0 AND LGPL-2.1-or-later) AND LicenseRef-scancode-proprietary-license, restricted, #13190
4343
maven/mavencentral/com.rameshkp/openapi-merger-app/1.0.5, Apache-2.0, approved, clearlydefined
4444
maven/mavencentral/com.rameshkp/openapi-merger-gradle-plugin/1.0.5, Apache-2.0, approved, #9669
4545
maven/mavencentral/commons-beanutils/commons-beanutils/1.9.4, Apache-2.0, approved, CQ12654
@@ -80,7 +80,7 @@ maven/mavencentral/joda-time/joda-time/2.9.7, Apache-2.0, approved, CQ11988
8080
maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.14.11, Apache-2.0, approved, #7164
8181
maven/mavencentral/net.bytebuddy/byte-buddy/1.14.11, Apache-2.0 AND BSD-3-Clause, approved, #7163
8282
maven/mavencentral/net.sf.jopt-simple/jopt-simple/5.0.3, MIT, approved, CQ13174
83-
maven/mavencentral/net.sf.saxon/Saxon-HE/12.3, NOASSERTION, restricted, clearlydefined
83+
maven/mavencentral/net.sf.saxon/Saxon-HE/12.3, MPL-2.0-no-copyleft-exception AND (LicenseRef-scancode-proprietary-license AND MPL-2.0-no-copyleft-exception) AND (MPL-2.0-no-copyleft-exception AND X11) AND (MIT AND MPL-2.0-no-copyleft-exception) AND (MPL-1.0 AND MPL-2.0-no-copyleft-exception) AND (Apache-2.0 AND MPL-2.0-no-copyleft-exception) AND MPL-1.0, restricted, #13191
8484
maven/mavencentral/net.steppschuh.markdowngenerator/markdowngenerator/1.3.1.1, Apache-2.0, approved, clearlydefined
8585
maven/mavencentral/org.antlr/antlr4-runtime/4.11.1, BSD-3-Clause, approved, clearlydefined
8686
maven/mavencentral/org.apache.commons/commons-lang3/3.12.0, Apache-2.0, approved, clearlydefined

buildSrc/build.gradle.kts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import java.nio.file.Files
2+
import java.time.LocalDateTime
23

34
plugins {
45
`java-gradle-plugin`
@@ -71,7 +72,23 @@ val createVersions = tasks.register("createVersions") {
7172
doLast {
7273
versionCatalogs.find("libs")
7374
.ifPresent { catalog ->
74-
val head = "package org.eclipse.edc.plugins.edcbuild;\npublic interface Versions {\n"
75+
val copyright = """
76+
/*
77+
* Copyright (c) ${LocalDateTime.now().year} Contributors to the Eclipse Foundation
78+
*
79+
* This program and the accompanying materials are made available under the
80+
* terms of the Apache License, Version 2.0 which is available at
81+
* https://www.apache.org/licenses/LICENSE-2.0
82+
*
83+
* SPDX-License-Identifier: Apache-2.0
84+
*
85+
* Contributors:
86+
* Contributors to the Eclipse Foundation - initial API and implementation
87+
*
88+
*/
89+
""".trimIndent()
90+
91+
val head = "$copyright\n\npackage org.eclipse.edc.plugins.edcbuild;\npublic interface Versions {\n"
7592
val tail = "\n}";
7693

7794
val constants = listOf("assertj", "checkstyle", "jupiter", "mockito")

config/checkstyle/checkstyle.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
<module name="RegexpHeader">
5151
<property name="severity" value="warning"/>
5252
<property name="fileExtensions" value="java"/>
53-
<property name="header"
54-
value="^/\*$\n^ \* Copyright \(c\) 20\d\d((,| -) 20\d{2})? [A-Za-z].+\S$\n^ \*$\n^ \* This program and the accompanying materials are made available under the$\n^ \* terms of the Apache License, Version 2\.0 which is available at$\n^ \* https://www\.apache\.org/licenses/LICENSE-2\.0$\n^ \*$\n^ \* SPDX-License-Identifier: Apache-2\.0$\n^ \*$\n^ \* Contributors:$\n^ \* \S.*\S$\n^ \*$\n^ \*/$\n^$\n^package"/>
53+
<property name="headerFile" value="${config_loc}/java.header"/>
5554
<property name="multiLines" value="11"/>
5655
</module>
5756

config/checkstyle/java.header

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
^/\*$
2+
^ \* Copyright \(c\) 20\d\d((,| -) 20\d{2})? [A-Za-z].+\S$
3+
^ \*$
4+
^ \* This program and the accompanying materials are made available under the$
5+
^ \* terms of the Apache License, Version 2\.0 which is available at$
6+
^ \* https://www\.apache\.org/licenses/LICENSE-2\.0$
7+
^ \*$
8+
^ \* SPDX-License-Identifier: Apache-2\.0$
9+
^ \*$
10+
^ \* Contributors:$
11+
^ \* \S.*\S$
12+
^ \*$
13+
^ \*/$
14+
^$
15+
^package

plugins/autodoc/autodoc-plugin/src/main/java/org/eclipse/edc/plugins/autodoc/AutodocPlugin.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2+
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
33
*
4-
* This program and the accompanying materials are made available under the
5-
* terms of the Apache License, Version 2.0 which is available at
6-
* https://www.apache.org/licenses/LICENSE-2.0
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Apache License, Version 2.0 which is available at
6+
* https://www.apache.org/licenses/LICENSE-2.0
77
*
8-
* SPDX-License-Identifier: Apache-2.0
8+
* SPDX-License-Identifier: Apache-2.0
99
*
10-
* Contributors:
10+
* Contributors:
1111
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
1212
*
1313
*/

plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/conventions/CheckstyleConvention.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class CheckstyleConvention implements EdcConvention {
3333

3434
@Override
3535
public void apply(Project target) {
36-
var cse = requireExtension(target, CheckstyleExtension.class);
36+
var extension = requireExtension(target, CheckstyleExtension.class);
3737

38-
cse.setToolVersion(Versions.CHECKSTYLE);
39-
cse.setMaxErrors(0);
40-
target.getTasks().withType(Checkstyle.class, cs -> cs.reports(r -> {
38+
extension.setToolVersion(Versions.CHECKSTYLE);
39+
extension.setMaxErrors(0);
40+
extension.setMaxWarnings(0);
41+
42+
target.getTasks().withType(Checkstyle.class, checkstyle -> checkstyle.reports(r -> {
4143
r.getHtml().getRequired().set(false);
4244
r.getXml().getRequired().set(true);
4345
}));

0 commit comments

Comments
 (0)