From 3fb2eb12f42c4a4e15462a922f76dcd4a61a00a5 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sun, 14 Aug 2022 19:58:22 +0200 Subject: [PATCH] Improvement checkstyle configuration - by default don't check herders for licences - provide headers template for ASF 2.0 and MIT --- config-assembly.xml | 20 ++++++++ pom.xml | 56 +++++++++++++++------ src/main/config/checkstyle/asf20-header.txt | 17 +++++++ src/main/config/checkstyle/empty-header.txt | 0 src/main/config/checkstyle/mit-header.txt | 25 +++++++++ 5 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 config-assembly.xml create mode 100644 src/main/config/checkstyle/asf20-header.txt create mode 100644 src/main/config/checkstyle/empty-header.txt create mode 100644 src/main/config/checkstyle/mit-header.txt diff --git a/config-assembly.xml b/config-assembly.xml new file mode 100644 index 0000000..b8c51eb --- /dev/null +++ b/config-assembly.xml @@ -0,0 +1,20 @@ + + + + config + + + jar + + + false + + + + src/main/config + mojohaus/config + + + diff --git a/pom.xml b/pom.xml index 6f5f0d9..922a65a 100644 --- a/pom.xml +++ b/pom.xml @@ -305,15 +305,37 @@ maven-checkstyle-plugin ${maven-checkstyle-plugin.version} + + src/main/java + + + src/test/java + + true config/maven_checks.xml - config/maven-header.txt + + mojohaus/config/checkstyle/empty-header.txt + + + validate + + check + + + org.apache.maven.shared maven-shared-resources 4 + + org.codehaus.mojo + mojo-parent + 70-SNAPSHOT + config + com.puppycrawl.tools checkstyle @@ -525,16 +547,8 @@ + - - - org.apache.maven.plugins - maven-checkstyle-plugin - org.apache.maven.plugins maven-enforcer-plugin @@ -610,6 +624,24 @@ + + org.apache.maven.plugins + maven-assembly-plugin + false + + + config-assembly.xml + + + + + package + + single + + + + @@ -737,10 +769,6 @@ org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - - config/maven_checks.xml - config/maven-header.txt - diff --git a/src/main/config/checkstyle/asf20-header.txt b/src/main/config/checkstyle/asf20-header.txt new file mode 100644 index 0000000..8b77d64 --- /dev/null +++ b/src/main/config/checkstyle/asf20-header.txt @@ -0,0 +1,17 @@ +^package + +^/\*$ +^ \* Copyright +^ \*$ +^ \* 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.$ +^ \*/$ diff --git a/src/main/config/checkstyle/empty-header.txt b/src/main/config/checkstyle/empty-header.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/main/config/checkstyle/mit-header.txt b/src/main/config/checkstyle/mit-header.txt new file mode 100644 index 0000000..7709f69 --- /dev/null +++ b/src/main/config/checkstyle/mit-header.txt @@ -0,0 +1,25 @@ +^package + +^/\*$ +^ \* The MIT License$ +^ \*$ +^ \* Copyright +^ \*$ +^ \* Permission is hereby granted, free of charge, to any person obtaining a copy of$ +^ \* this software and associated documentation files (the "Software"), to deal in$ +^ \* the Software without restriction, including without limitation the rights to$ +^ \* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies$ +^ \* of the Software, and to permit persons to whom the Software is furnished to do$ +^ \* so, subject to the following conditions:$ +^ \*$ +^ \* The above copyright notice and this permission notice shall be included in all$ +^ \* copies or substantial portions of the Software.$ +^ \*$ +^ \* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR$ +^ \* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,$ +^ \* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE$ +^ \* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER$ +^ \* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,$ +^ \* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE$ +^ \* SOFTWARE. +^ \*/$