Skip to content

Commit 964f5d1

Browse files
#86 Checkstyle
1 parent 2a4251f commit 964f5d1

25 files changed

+1284
-167
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ trim_trailing_whitespace = true
1010

1111
# noinspection EditorConfigKeyCorrectness
1212
continuation_indent_size = 8
13+
14+
[{*.raml,*.yaml,*.yml}]
15+
indent_size = 2
16+
17+
[{*.markdown,*.md}]
18+
indent_size = 2
19+
max_line_length = 120
20+
tab_width = 2
21+
ij_continuation_indent_size = 4

NOTICE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gson-utils
1+
zip4jvm
22
Copyright 2021 Oleg Cherednik (oleg.cherednik@gmail.com)
33

44
This product includes software developed by

_config.yml

-1
This file was deleted.

build.gradle

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import com.github.jk1.license.filter.LicenseBundleNormalizer
2+
import com.github.jk1.license.render.InventoryHtmlReportRenderer
3+
14
buildscript {
25
repositories {
36
mavenLocal()
@@ -8,8 +11,10 @@ buildscript {
811
plugins {
912
id 'jacoco'
1013
id 'java-library'
14+
id 'io.freefair.lombok' version '8.4'
15+
1116
id 'org.cadixdev.licenser' version '0.6.1'
12-
id 'io.franzbecker.gradle-lombok' version '5.0.0'
17+
id 'com.github.jk1.dependency-license-report' version '2.5'
1318
id 'com.github.ben-manes.versions' version '0.51.0'
1419

1520
id 'signing'
@@ -25,13 +30,21 @@ repositories {
2530
group 'ru.oleg-cherednik.zip4jvm'
2631
version '1.11'
2732

28-
sourceCompatibility = '1.8'
29-
targetCompatibility = '1.8'
33+
sourceCompatibility = JavaVersion.VERSION_1_8
34+
targetCompatibility = JavaVersion.VERSION_1_8
3035

3136
tasks.withType(JavaCompile).configureEach {
3237
options.encoding = 'UTF-8'
38+
options.compilerArgs += ['-Xlint:unchecked']
3339
}
3440

41+
configurations {
42+
jar.archiveFileName = "${rootProject.name}-${version}.jar"
43+
}
44+
45+
apply from: "${projectDir}/gradle/checkstyle.gradle"
46+
apply from: "${projectDir}/gradle/pmd.gradle"
47+
3548
dependencies {
3649
annotationProcessor "org.projectlombok:lombok:${property('lombok.version')}"
3750

@@ -64,9 +77,16 @@ jacocoTestReport {
6477
}
6578
}
6679

67-
check.dependsOn jacocoTestReport
80+
javadoc {
81+
options.addBooleanOption('Xdoclint:-missing', true)
82+
}
83+
84+
check.finalizedBy(checkLicense)
85+
check.finalizedBy(generateLicenseReport)
86+
check.finalizedBy(jacocoTestReport)
6887

6988
test {
89+
dependsOn('jar')
7090
useTestNG()
7191
}
7292

@@ -76,6 +96,13 @@ license {
7696
newLine false
7797
}
7898

99+
licenseReport {
100+
configurations = ['compileClasspath', 'runtimeClasspath', 'testCompileClasspath', 'testRuntimeClasspath']
101+
renderers = [new InventoryHtmlReportRenderer()]
102+
allowedLicensesFile = new File("$projectDir/misc/license/allowed-licenses.json")
103+
filters = [new LicenseBundleNormalizer(bundlePath: "$projectDir/misc/license/license-normalizer-bundle.json")]
104+
}
105+
79106
signing {
80107
sign publishing.publications
81108
}

codecov.yml

-4
This file was deleted.

gradle/checkstyle.gradle

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apply plugin: 'checkstyle'
2+
3+
checkstyle {
4+
toolVersion = '10.10.0'
5+
configFile = file("${projectDir}/misc/checkstyle/checkstyle.xml")
6+
ignoreFailures = false
7+
maxWarnings = 0
8+
maxErrors = 0
9+
}
10+
11+
checkstyleMain {
12+
enabled = true
13+
source = 'src/main/java'
14+
group = 'static analysis'
15+
}
16+
17+
checkstyleTest {
18+
enabled = true
19+
source = 'src/test/java'
20+
group = 'static analysis'
21+
}

gradle/pmd.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'pmd'
2+
3+
pmd {
4+
toolVersion = '6.21.0'
5+
consoleOutput = false
6+
rulesMinimumPriority = 5
7+
ignoreFailures = false
8+
ruleSets = [
9+
"${projectDir}/misc/pmd/bestpractices.xml",
10+
"${projectDir}/misc/pmd/codestyle.xml",
11+
"${projectDir}/misc/pmd/design.xml",
12+
"${projectDir}/misc/pmd/errorprone.xml",
13+
"${projectDir}/misc/pmd/multithreading.xml",
14+
"${projectDir}/misc/pmd/performance.xml",
15+
"${projectDir}/misc/pmd/security.xml"
16+
]
17+
}
18+
19+
pmdMain {
20+
enabled = true
21+
source = 'src/main/java'
22+
group = 'static analysis'
23+
}
24+
25+
pmdTest {
26+
dependsOn('jar')
27+
enabled = true
28+
source = 'src/test/java'
29+
group = 'static analysis'
30+
}

java.png

-18.4 KB
Binary file not shown.

lombok.config

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://projectlombok.org/features/configuration
2+
3+
# configuration file is in the root of the workspace directory only
4+
config.stopBubbling = true
5+
# If true, lombok will generate a @java.beans.ConstructorProperties annotation when generating constructors.
6+
lombok.anyConstructor.addConstructorProperties=true
7+
# Do not use experimental annotations
8+
lombok.experimental.flagUsage=ERROR
9+
# Lombok marks generated code with @lombok.Generated, so JaCoCo can understand it
10+
lombok.addLombokGeneratedAnnotation = true

0 commit comments

Comments
 (0)