Skip to content

Commit 80f0785

Browse files
committed
trying to get checkstyle to work
1 parent c3041dd commit 80f0785

4 files changed

Lines changed: 449 additions & 11 deletions

File tree

NOTES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
* Running `gradle wrapper` to get the latest version.
77
* Setting up dev container with [Setting up a Java project for GitHub Codespaces](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-java-project-for-codespaces)
88
* https://devqa.io/junit-5-annotations/
9-
* Updated CI.yml https://github.com/gradle/gradle-build-action
9+
* Updated CI.yml https://github.com/gradle/gradle-build-action
10+
* https://stackoverflow.com/a/31622432/1245251

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,5 @@
66

77
---
88

9-
# Base Template for Dev Playbooks
9+
# Java / Gradle / JUnit Jupiter Dev Playbook
1010

11-
Includes:
12-
13-
* [Actions Blank CI Starter Workglow](https://github.com/actions/starter-workflows/blob/main/ci/blank.yml)
14-
* [bnb's](https://github.com/bnb) [Codespaces Base Starter](https://github.com/codespaces-examples/base)
15-
* Choice of licenses:
16-
* [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
17-
* [GPL 3.0 License](https://www.gnu.org/licenses/gpl-3.0.en.html)
18-
* [MIT License](https://opensource.org/license/mit/)
19-
* [Shields.io](https://shields.io/) [Badges](https://github.com/badges/shields)

build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java'
33
id 'com.adarshr.test-logger' version '4.0.0'
4+
id 'checkstyle'
45
id 'idea' // optional (to generate IntelliJ IDEA project files)
56
}
67

@@ -13,6 +14,7 @@ java {
1314

1415
repositories {
1516
mavenCentral()
17+
jcenter()
1618
}
1719

1820
dependencies {
@@ -24,4 +26,28 @@ dependencies {
2426

2527
test {
2628
useJUnitPlatform()
29+
}
30+
31+
apply plugin: 'checkstyle'
32+
checkstyle {
33+
toolVersion = '10.3' // Specify the Checkstyle version
34+
configFile = file('config/checkstyle/checkstyle.xml') // Path to your checkstyle.xml
35+
36+
ignoreFailures = false
37+
showViolations = true
38+
}
39+
40+
checkstyleMain {
41+
source ='src/main/java'
42+
}
43+
44+
checkstyleTest {
45+
source ='src/test/java'
46+
}
47+
48+
tasks.withType(Checkstyle) {
49+
reports {
50+
xml.required.set(false)
51+
html.required.set(true) // Enable HTML report
52+
}
2753
}

0 commit comments

Comments
 (0)