Skip to content

Commit

Permalink
Update Checkstyle and JaCoCo to build on JDK 18 (#637)
Browse files Browse the repository at this point in the history
This PR updates Checkstyle to the most recent version and removes
deleted/replaced/changed properties. In addition, JaCoCo is updated.

Both updates support Java 18, which fixes the currently failing build.

# Deleted

`allowMissingThrowsTags` and `allowUndeclaredRTE`:

> properties `allowMissingThrowsTags`, `allowUndeclaredRTE` [...] should
> be just removed from configs.
> Behavior will change as there will be less violations in code, such
> properties did not work well so their removal should be ok, as there
> will be less false-positives.

See:

* https://checkstyle.sourceforge.io/releasenotes.html#Release_8.21
* checkstyle/checkstyle#6703

# Replaced

`allowMissingJavadoc`:

Replaced by
[`MissingJavadocMethod`](https://checkstyle.org/config_javadoc.html#MissingJavadocMethod).
That is, missing Javadoc is now allowed by default.

See:

* https://checkstyle.sourceforge.io/releasenotes.html#Release_8.28
* checkstyle/checkstyle#7329

# Changed

`allowMissingThrowsTags`:

`validateThrows` now means we can no longer omit `@throws` in Javadoc.
Whenever a method declares `throws`, it must be documented.

Furthermore, Checkstyle authors say:

> If you need to validate `@throws` please enable property
> `validateThrows` but please read documentation as there some
> limitations -
> https://checkstyle.org/config_javadoc.html#JavadocMethod .
> Old documentation is at
> https://checkstyle.sourceforge.io/version/8.27/config_javadoc.html#JavadocMethod

See:

* https://checkstyle.sourceforge.io/releasenotes.html#Release_8.21
* checkstyle/checkstyle#6703

---

PR: #637
  • Loading branch information
beatngu13 committed May 19, 2022
1 parent 544b71f commit b6a19c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions .infra/checkstyle/checkstyle.xml
Expand Up @@ -3,18 +3,14 @@

<module name="Checker">
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
<property name="file" value="${config_loc}/suppressions.xml" />
</module>
<property name="severity" value="error" />
<module name="TreeWalker">
<module name="SuppressWarningsHolder" />
<module name="JavadocMethod">
<property name="allowMissingJavadoc" value="true" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
<property name="allowMissingThrowsTags" value="true" />
<property name="allowUndeclaredRTE" value="true" />
<property name="validateThrows" value="true" />
</module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @exception, @since, @author, @see" />
Expand All @@ -25,12 +21,12 @@
</module>
<module name="AvoidStarImport" />
<module name="ImportControl">
<property name="file" value="${config_loc}/import-control.xml"/>
<property name="file" value="${config_loc}/import-control.xml" />
</module>
</module>
<module name="JavadocPackage" />
<module name="SuppressWarningsFilter" />
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
<property name="fileNamePattern" value="module\-info\.java$" />
</module>
</module>
4 changes: 2 additions & 2 deletions build.gradle.kts
Expand Up @@ -90,7 +90,7 @@ spotless {
}

checkstyle {
toolVersion = "7.8.2"
toolVersion = "10.2"
configDirectory.set(rootProject.file(".infra/checkstyle"))
}

Expand All @@ -100,7 +100,7 @@ yamlValidator {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.8"
}

sonarqube {
Expand Down

0 comments on commit b6a19c1

Please sign in to comment.