1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-21 12:43:21 +00:00

Run checkstyle on all source sets

Had an issue last week where testFixtures had a couple of issues which I
didn't pick up on, as the pre-commit hooks only check the main and test
source set.

We now add a per-project "checkstyle" task, which dependes on the
per-source-set checkstyle tasks.
This commit is contained in:
Jonathan Coates 2023-10-03 09:06:17 +01:00
parent 96b6947ef2
commit 0a31de43c2
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
3 changed files with 7 additions and 2 deletions

View File

@ -44,7 +44,7 @@ repos:
name: Check Java codestyle
files: ".*\\.java$"
language: system
entry: ./gradlew checkstyleMain checkstyleTest
entry: ./gradlew checkstyle
pass_filenames: false
require_serial: true
- id: illuaminate

View File

@ -100,7 +100,6 @@ ## Writing documentation
[new-issue]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose "Create a new issue"
[community]: README.md#community "Get in touch with the community."
[Adoptium]: https://adoptium.net/temurin/releases?version=17 "Download OpenJDK 17"
[checkstyle]: https://checkstyle.org/
[illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub"
[weblate]: https://i18n.tweaked.cc/projects/cc-tweaked/minecraft/ "CC: Tweaked weblate instance"
[docs]: https://tweaked.cc/ "CC: Tweaked documentation"

View File

@ -174,6 +174,12 @@ project.plugins.withType(CCTweakedPlugin::class.java) {
}
}
tasks.register("checkstyle") {
description = "Run Checkstyle on all sources"
group = LifecycleBasePlugin.VERIFICATION_GROUP
dependsOn(tasks.withType(Checkstyle::class.java))
}
spotless {
encoding = StandardCharsets.UTF_8
lineEndings = LineEnding.UNIX