Skip to content

Commit

Permalink
#86 Checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-cherednik committed Oct 13, 2024
1 parent 2a4251f commit 2f5a296
Show file tree
Hide file tree
Showing 545 changed files with 3,906 additions and 2,315 deletions.
15 changes: 14 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 150
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true

# noinspection EditorConfigKeyCorrectness
continuation_indent_size = 8

[{*.raml,*.yaml,*.yml}]
indent_size = 2

[{*.markdown,*.md}]
indent_size = 2
tab_width = 2
ij_continuation_indent_size = 4

[*.java]
ij_java_imports_layout = ru.olegcherednik.zip4jvm.**,|,*,|,java.**,javax.**,|,$*


2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gson-utils
zip4jvm
Copyright 2021 Oleg Cherednik ([email protected])

This product includes software developed by
Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

35 changes: 31 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.InventoryHtmlReportRenderer

buildscript {
repositories {
mavenLocal()
Expand All @@ -8,8 +11,10 @@ buildscript {
plugins {
id 'jacoco'
id 'java-library'
id 'io.freefair.lombok' version '8.4'

id 'org.cadixdev.licenser' version '0.6.1'
id 'io.franzbecker.gradle-lombok' version '5.0.0'
id 'com.github.jk1.dependency-license-report' version '2.5'
id 'com.github.ben-manes.versions' version '0.51.0'

id 'signing'
Expand All @@ -25,13 +30,21 @@ repositories {
group 'ru.oleg-cherednik.zip4jvm'
version '1.11'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

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

configurations {
jar.archiveFileName = "${rootProject.name}-${version}.jar"
}

apply from: "${projectDir}/gradle/checkstyle.gradle"
apply from: "${projectDir}/gradle/pmd.gradle"

dependencies {
annotationProcessor "org.projectlombok:lombok:${property('lombok.version')}"

Expand Down Expand Up @@ -64,9 +77,16 @@ jacocoTestReport {
}
}

check.dependsOn jacocoTestReport
javadoc {
options.addBooleanOption('Xdoclint:-missing', true)
}

check.finalizedBy(checkLicense)
check.finalizedBy(generateLicenseReport)
check.finalizedBy(jacocoTestReport)

test {
dependsOn('jar')
useTestNG()
}

Expand All @@ -76,6 +96,13 @@ license {
newLine false
}

licenseReport {
configurations = ['compileClasspath', 'runtimeClasspath', 'testCompileClasspath', 'testRuntimeClasspath']
renderers = [new InventoryHtmlReportRenderer()]
allowedLicensesFile = new File("$projectDir/misc/license/allowed-licenses.json")
filters = [new LicenseBundleNormalizer(bundlePath: "$projectDir/misc/license/license-normalizer-bundle.json")]
}

signing {
sign publishing.publications
}
Expand Down
4 changes: 0 additions & 4 deletions codecov.yml

This file was deleted.

24 changes: 24 additions & 0 deletions gradle/checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'checkstyle'

checkstyle {
toolVersion = '10.10.0'
configFile = file("${projectDir}/misc/checkstyle/checkstyle.xml")
ignoreFailures = false
maxWarnings = 0
maxErrors = 0
}

checkstyleMain {
enabled = true
source = 'src/main/java'
group = 'static analysis'
exclude 'ru/olegcherednik/zip4jvm/io/bzip2/**'
exclude 'ru/olegcherednik/zip4jvm/io/ed/**'
exclude 'ru/olegcherednik/zip4jvm/io/lzma/**'
}

checkstyleTest {
enabled = true
source = 'src/test/java'
group = 'static analysis'
}
33 changes: 33 additions & 0 deletions gradle/pmd.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apply plugin: 'pmd'

pmd {
toolVersion = '7.0.0'
consoleOutput = false
rulesMinimumPriority = 5
ignoreFailures = false
ruleSets = [
"${projectDir}/misc/pmd/bestpractices.xml",
"${projectDir}/misc/pmd/codestyle.xml",
"${projectDir}/misc/pmd/design.xml",
"${projectDir}/misc/pmd/errorprone.xml",
"${projectDir}/misc/pmd/multithreading.xml",
"${projectDir}/misc/pmd/performance.xml",
"${projectDir}/misc/pmd/security.xml"
]
}

pmdMain {
enabled = true
source = 'src/main/java'
group = 'static analysis'
exclude 'ru/olegcherednik/zip4jvm/io/bzip2/**'
exclude 'ru/olegcherednik/zip4jvm/io/ed/**'
exclude 'ru/olegcherednik/zip4jvm/io/lzma/**'
}

pmdTest {
dependsOn('jar')
enabled = true
source = 'src/test/java'
group = 'static analysis'
}
Binary file removed java.png
Binary file not shown.
10 changes: 10 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://projectlombok.org/features/configuration

# configuration file is in the root of the workspace directory only
config.stopBubbling = true
# If true, lombok will generate a @java.beans.ConstructorProperties annotation when generating constructors.
lombok.anyConstructor.addConstructorProperties=true
# Do not use experimental annotations
lombok.experimental.flagUsage=ERROR
# Lombok marks generated code with @lombok.Generated, so JaCoCo can understand it
lombok.addLombokGeneratedAnnotation = true
Loading

0 comments on commit 2f5a296

Please sign in to comment.