DSpace / DSpace

(Official) The DSpace digital asset management system that powers your Institutional Repository
https://wiki.lyrasis.org/display/DSDOC7x/
BSD 3-Clause "New" or "Revised" License
850 stars 1.28k forks source link

Updated CheckStyle to support newer Java features while not changing anything else #9555

Closed jeffmorin closed 3 weeks ago

jeffmorin commented 3 weeks ago

The CheckStyle version currently used, 8.30, doesn't support newer Java features such as string blocks. As a result, the plugin fails parsing any class including at least one string block, which makes the Maven build fail as well.

This PR updates the CheckStyle plugin so that:

  1. Newer Java features such as string blocks are properly supported while running CheckStyle on the codebase.
  2. No other changes are required for the project to build:
    • No changes to checkstyle.xml are required. The latest version that fulfils this criterion is 8.41.1 — versions 8.42 and later require adding a scope attribute.
    • No existing rules change in their interpretation, i.e. no new CheckStyle errors appear if the code remains unchanged. The latest version that fulfils this criterion is 8.38 — versions 8.39 and later introduce rule and rule interpretation changes, which results in new CheckStyle errors being thrown and failing the build if the codebase remains unchanged.

Therefore, to minimize impact on the existing code, this PR updates CheckStyle to version 8.38.

References

https://github.com/DSpace/DSpace/issues/8441

Description

The CheckStyle version is updated from 8.30 to 8.38 in the project parent pom.xml.

Instructions for Reviewers

Just import the updated pom.xml file and build the project.

The project will still build properly without having to change anything. If a class featuring string blocks is added, it will compile and be "check-styled" without throwing any plugin- or configuration-related exceptions.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

Unchecked boxes below are not applicable to this PR.

dspace-bot commented 3 weeks ago

Successfully created backport PR for dspace-7_x: