Skip to content

Commit

Permalink
Add license headers and exclude specific files in Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamura-to committed Jan 3, 2025
1 parent 1e9b367 commit 790b76f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,24 @@ allprojects {
}

spotless {
val targetExclude = "src/test/java/org/seasar/aptina/unit/*.java"
val licenseHeaderFile = rootProject.file("spotless/copyright.java")

lineEndings = com.diffplug.spotless.LineEnding.UNIX
java {
targetExclude(targetExclude)
googleJavaFormat(catalog.google.java.format.get().version)
licenseHeaderFile(licenseHeaderFile)
}
// https://github.com/diffplug/spotless/issues/532
format("javaMisc") {
targetExclude(targetExclude)
target("src/**/package-info.java", "src/**/module-info.java")
licenseHeaderFile(licenseHeaderFile, "(package|module|\\/\\*\\*)")
}
kotlin {
ktlint(catalog.ktlint.get().version)
licenseHeaderFile(licenseHeaderFile)
}
kotlinGradle {
ktlint(catalog.ktlint.get().version)
Expand Down
15 changes: 15 additions & 0 deletions spotless/copyright.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Doma Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

0 comments on commit 790b76f

Please sign in to comment.