mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49:21 +08:00
Don't handle copyrights in spotless (#1438)
It can get it wrong too easily
This commit is contained in:
@@ -48,63 +48,26 @@ spotless {
|
|||||||
indentWithSpaces(2)
|
indentWithSpaces(2)
|
||||||
endWithNewline()
|
endWithNewline()
|
||||||
}
|
}
|
||||||
val externalJavaFiles = arrayOf(
|
|
||||||
"**/ClassFactory.java",
|
|
||||||
"**/Iso8601Utils.java",
|
|
||||||
"**/JsonReader.java",
|
|
||||||
"**/JsonReaderPathTest.java",
|
|
||||||
"**/JsonReaderTest.java",
|
|
||||||
"**/JsonScope.java",
|
|
||||||
"**/JsonUtf8Reader.java",
|
|
||||||
"**/JsonUtf8ReaderPathTest.java",
|
|
||||||
"**/JsonUtf8ReaderTest.java",
|
|
||||||
"**/JsonUtf8ReaderTest.java",
|
|
||||||
"**/JsonUtf8Writer.java",
|
|
||||||
"**/JsonUtf8WriterTest.java",
|
|
||||||
"**/JsonWriter.java",
|
|
||||||
"**/JsonWriterPathTest.java",
|
|
||||||
"**/JsonWriterTest.java",
|
|
||||||
"**/LinkedHashTreeMap.java",
|
|
||||||
"**/LinkedHashTreeMapTest.java",
|
|
||||||
"**/PolymorphicJsonAdapterFactory.java",
|
|
||||||
"**/RecursiveTypesResolveTest.java",
|
|
||||||
"**/Types.java",
|
|
||||||
"**/TypesTest.java"
|
|
||||||
)
|
|
||||||
val configureCommonJavaFormat: JavaExtension.() -> Unit = {
|
val configureCommonJavaFormat: JavaExtension.() -> Unit = {
|
||||||
googleJavaFormat(libs.versions.gjf.get())
|
googleJavaFormat(libs.versions.gjf.get())
|
||||||
}
|
}
|
||||||
java {
|
java {
|
||||||
configureCommonJavaFormat()
|
configureCommonJavaFormat()
|
||||||
target("**/*.java")
|
target("**/*.java")
|
||||||
targetExclude(
|
targetExclude("**/build/**",)
|
||||||
"**/spotless.java",
|
|
||||||
"**/build/**",
|
|
||||||
*externalJavaFiles
|
|
||||||
)
|
|
||||||
licenseHeaderFile("spotless/spotless.java")
|
|
||||||
}
|
|
||||||
format("externalJava", JavaExtension::class.java) {
|
|
||||||
// These don't use our spotless config for header files since we don't want to overwrite the
|
|
||||||
// existing copyright headers.
|
|
||||||
configureCommonJavaFormat()
|
|
||||||
target(*externalJavaFiles)
|
|
||||||
}
|
}
|
||||||
kotlin {
|
kotlin {
|
||||||
ktlint(libs.versions.ktlint.get()).userData(mapOf("indent_size" to "2"))
|
ktlint(libs.versions.ktlint.get()).userData(mapOf("indent_size" to "2"))
|
||||||
target("**/*.kt")
|
target("**/*.kt")
|
||||||
trimTrailingWhitespace()
|
trimTrailingWhitespace()
|
||||||
endWithNewline()
|
endWithNewline()
|
||||||
licenseHeaderFile("spotless/spotless.kt")
|
targetExclude("**/Dependencies.kt", "**/build/**")
|
||||||
.updateYearWithLatest(false)
|
|
||||||
targetExclude("**/Dependencies.kt", "**/spotless.kt", "**/build/**")
|
|
||||||
}
|
}
|
||||||
kotlinGradle {
|
kotlinGradle {
|
||||||
ktlint(libs.versions.ktlint.get()).userData(mapOf("indent_size" to "2"))
|
ktlint(libs.versions.ktlint.get()).userData(mapOf("indent_size" to "2"))
|
||||||
target("**/*.gradle.kts")
|
target("**/*.gradle.kts")
|
||||||
trimTrailingWhitespace()
|
trimTrailingWhitespace()
|
||||||
endWithNewline()
|
endWithNewline()
|
||||||
licenseHeaderFile("spotless/spotless.kts", "(import|plugins|buildscript|dependencies|pluginManagement)")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) $YEAR Square, Inc.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
@@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) $YEAR Square, Inc.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
@@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) $YEAR Square, Inc.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
Reference in New Issue
Block a user