Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6992 Add SPDX checking for copyright/license (java) #7404

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id 'dev.jacomet.logging-capabilities' version "0.11.0"
// This plugin helps resolve jakarta/javax dev.jacomet.logging-capabilities
id 'org.gradlex.java-ecosystem-capabilities' version "1.1"
id 'checkstyle'
}


Expand All @@ -29,6 +30,7 @@ allprojects {
version = '4.0-SNAPSHOT'

// Mostly java, so default to this for now
apply plugin: 'checkstyle'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'org.gradlex.java-ecosystem-capabilities'
Expand Down Expand Up @@ -423,6 +425,14 @@ allprojects {
task printSubDependencies(type: DependencyReportTask) {}
task findDependency(type: DependencyInsightReportTask) {}

// Checking of headers etc
checkstyle {
toolVersion = '10.7.0'
// Whilst initially adding, soft warnings only, as there are fixes needed
ignoreFailures = true
showViolations = true
}

} // end of allProjects

// Whilst all modules have their own javadoc, we only build
Expand Down Expand Up @@ -524,5 +534,7 @@ dependencyAnalysis {
}
}



// Always run dependency check for every regular build
build.dependsOn("buildHealth")
17 changes: 17 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">


<module name="Regexp">
<property name="format" value="/\*[ ]{1,}SPDX-License-Identifier: Apache-2\.0"/>
</module>

<module name="Regexp">
<property name="format" value="/\*[ ]{1,}Copyright Contributors to the( ODPi)? Egeria project"/>
</module>
</module>
</module>
2 changes: 2 additions & 0 deletions config/checkstyle/java.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^/* SPDX-License-Identifier: Apache-2.0 */$
^/* Copyright Contributors to the ODPi Egeria project. */$