From acf58f1887aa678ea28be4928d51d1370120f2a9 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 Jul 2020 20:26:27 +0200 Subject: [PATCH] Check for license headers in kotlin source files --- pmd-java/pom.xml | 10 +++-- .../lang/java/ast/ASTCatchStatementTest.kt | 4 ++ .../lang/java/ast/ASTMethodDeclarationTest.kt | 4 ++ .../pmd/lang/java/ast/ASTPatternTest.kt | 4 ++ .../pmd/lang/java/ast/Java11Test.kt | 3 ++ .../pmd/lang/java/ast/KotlinTestingDsl.kt | 4 ++ .../pmd/lang/java/ast/ParserTestSpec.kt | 4 ++ .../pmd/lang/java/ast/TestExtensions.kt | 4 ++ .../pmd/lang/java/ast/WildcardBoundsTest.kt | 4 ++ .../pmd/lang/kotlin/cpd/testdata/comment.kt | 4 ++ .../pmd/lang/kotlin/cpd/testdata/comment.txt | 2 +- .../pmd/lang/kotlin/cpd/testdata/imports.kt | 4 ++ .../pmd/lang/kotlin/cpd/testdata/increment.kt | 4 ++ .../lang/kotlin/cpd/testdata/increment.txt | 42 +++++++++---------- pmd-lang-test/pom.xml | 9 ++++ pmd-modelica/pom.xml | 9 ++++ pmd-scala-modules/pmd-scala-common/pom.xml | 4 ++ pom.xml | 3 +- 18 files changed, 96 insertions(+), 26 deletions(-) diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index ed1d2a5f53..162facde15 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -14,18 +14,22 @@ - ${basedir}/src/test/resources + ${project.basedir}/src/test/resources - ${basedir}/src/test/java + ${project.basedir}/src/test/java **/testdata/*.java + + + ${project.basedir}/src/test/kotlin + - ${basedir}/src/main/resources + ${project.basedir}/src/main/resources true diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchStatementTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchStatementTest.kt index f6534b1415..73a2c2d9b7 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchStatementTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchStatementTest.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.collections.shouldContainExactly diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt index cb37d0e866..b896147f99 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.test.shouldBe diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt index 64dc9dd6c1..a5258154f2 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.test.shouldBe diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt index 4f7e3fa53d..b3fa0815af 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt @@ -1,3 +1,6 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt index e3401c2c37..bff8c01fca 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import io.kotest.assertions.throwables.shouldThrow diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt index c877e8e860..3e0d8aabe7 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import io.kotest.core.config.Project diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt index 76558ff0a4..3ba376f489 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.ast.test.shouldMatch diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/WildcardBoundsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/WildcardBoundsTest.kt index c5f174e2f7..2dc1a0b8e9 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/WildcardBoundsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/WildcardBoundsTest.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe diff --git a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.kt b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.kt index 3f0e783d82..6e27f75fe7 100644 --- a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.kt +++ b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package com.github.shyiko.ktlint.internal var x = 0 diff --git a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.txt b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.txt index d13247bcc2..0ab2c6c2b3 100644 --- a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.txt +++ b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/comment.txt @@ -1,5 +1,5 @@ [Image] or [Truncated image[ Bcol Ecol -L3 +L7 [var] 1 3 [x] 5 5 [=] 7 7 diff --git a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/imports.kt b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/imports.kt index 3f284aa546..b35619b85b 100644 --- a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/imports.kt +++ b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/imports.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + import java.math.BigInteger import java.math.BigInteger as BigInt import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm diff --git a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.kt b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.kt index 58bd764e53..065a7ffe9a 100644 --- a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.kt +++ b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.kt @@ -1,3 +1,7 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + package com.github.shyiko.ktlint.internal var x = 0 diff --git a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.txt b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.txt index 661e0ceb3a..365ee4cae8 100644 --- a/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.txt +++ b/pmd-kotlin/src/test/resources/net/sourceforge/pmd/lang/kotlin/cpd/testdata/increment.txt @@ -1,10 +1,10 @@ [Image] or [Truncated image[ Bcol Ecol -L3 +L7 [var] 1 3 [x] 5 5 [=] 7 7 [0] 9 9 -L5 +L9 [fun] 1 3 [increment1] 5 14 [(] 15 15 @@ -14,7 +14,7 @@ L5 [+=] 22 23 [1] 25 25 [}] 27 27 -L6 +L10 [fun] 1 3 [increment2] 5 14 [(] 15 15 @@ -24,7 +24,7 @@ L6 [+=] 22 23 [1] 25 25 [}] 27 27 -L7 +L11 [fun] 1 3 [increment3] 5 14 [(] 15 15 @@ -34,7 +34,7 @@ L7 [+=] 22 23 [1] 25 25 [}] 27 27 -L8 +L12 [fun] 1 3 [increment4] 5 14 [(] 15 15 @@ -44,7 +44,7 @@ L8 [+=] 22 23 [1] 25 25 [}] 27 27 -L9 +L13 [fun] 1 3 [increment5] 5 14 [(] 15 15 @@ -54,7 +54,7 @@ L9 [+=] 22 23 [1] 25 25 [}] 27 27 -L10 +L14 [fun] 1 3 [increment6] 5 14 [(] 15 15 @@ -64,7 +64,7 @@ L10 [+=] 22 23 [1] 25 25 [}] 27 27 -L11 +L15 [fun] 1 3 [increment7] 5 14 [(] 15 15 @@ -74,7 +74,7 @@ L11 [+=] 22 23 [1] 25 25 [}] 27 27 -L12 +L16 [fun] 1 3 [increment8] 5 14 [(] 15 15 @@ -84,7 +84,7 @@ L12 [+=] 22 23 [1] 25 25 [}] 27 27 -L13 +L17 [fun] 1 3 [increment9] 5 14 [(] 15 15 @@ -94,7 +94,7 @@ L13 [+=] 22 23 [1] 25 25 [}] 27 27 -L14 +L18 [fun] 1 3 [increment10] 5 15 [(] 16 16 @@ -104,7 +104,7 @@ L14 [+=] 23 24 [1] 26 26 [}] 28 28 -L15 +L19 [fun] 1 3 [increment11] 5 15 [(] 16 16 @@ -114,7 +114,7 @@ L15 [+=] 23 24 [1] 26 26 [}] 28 28 -L16 +L20 [fun] 1 3 [increment12] 5 15 [(] 16 16 @@ -124,7 +124,7 @@ L16 [+=] 23 24 [1] 26 26 [}] 28 28 -L17 +L21 [fun] 1 3 [increment13] 5 15 [(] 16 16 @@ -134,7 +134,7 @@ L17 [+=] 23 24 [1] 26 26 [}] 28 28 -L18 +L22 [fun] 1 3 [increment14] 5 15 [(] 16 16 @@ -144,7 +144,7 @@ L18 [+=] 23 24 [1] 26 26 [}] 28 28 -L19 +L23 [fun] 1 3 [increment15] 5 15 [(] 16 16 @@ -154,7 +154,7 @@ L19 [+=] 23 24 [1] 26 26 [}] 28 28 -L20 +L24 [fun] 1 3 [increment16] 5 15 [(] 16 16 @@ -164,7 +164,7 @@ L20 [+=] 23 24 [1] 26 26 [}] 28 28 -L21 +L25 [fun] 1 3 [increment17] 5 15 [(] 16 16 @@ -174,7 +174,7 @@ L21 [+=] 23 24 [1] 26 26 [}] 28 28 -L22 +L26 [fun] 1 3 [increment18] 5 15 [(] 16 16 @@ -184,7 +184,7 @@ L22 [+=] 23 24 [1] 26 26 [}] 28 28 -L23 +L27 [fun] 1 3 [increment19] 5 15 [(] 16 16 @@ -194,7 +194,7 @@ L23 [+=] 23 24 [1] 26 26 [}] 28 28 -L24 +L28 [fun] 1 3 [increment20] 5 15 [(] 16 16 diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 2fcedf2c44..99510585c2 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -18,6 +18,15 @@ ${project.basedir}/src/main/kotlin + + + ${project.basedir}/src/test/resources + + + + ${project.basedir}/src/main/kotlin + + diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 3f64be86b0..580b39fa84 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -12,6 +12,15 @@ + + + ${project.basedir}/src/test/resources + + + + ${project.basedir}/src/test/kotlin + + maven-resources-plugin diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index 78238212f8..21b4f8de50 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -28,6 +28,10 @@ ../pmd-scala-common/src/test/resources + + + ../pmd-scala-common/src/test/kotlin + diff --git a/pom.xml b/pom.xml index 1846f3823b..da3b6a63a3 100644 --- a/pom.xml +++ b/pom.xml @@ -346,9 +346,10 @@ /net/sourceforge/pmd/pmd-checkstyle-suppressions.xml true + ${project.build.sourceDirectory} - **/*.properties,**/*.less + **/*.properties,**/*.less,**/*.kt