From 318b9e56d0b11a5ca4ea8da4879b4693bcf8763e Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Fri, 10 Jun 2016 15:31:29 +0200 Subject: Introduce coding style and checkstyle rules Change-Id: I1e67065393cdb901b81d5c5f8f3cec42f1b39fc8 Signed-off-by: Maros Marsalek --- common/checkstyle/pom.xml | 15 ++ .../src/main/resources/HONEYCOMB_LICENSE.txt | 15 ++ common/checkstyle/src/main/resources/README.adoc | 6 + .../resources/honeycomb-checkstyle-logging.xml | 67 +++++++ .../src/main/resources/honeycomb-checkstyle.xml | 188 +++++++++++++++++++ .../main/resources/intellij-java-coding-style.xml | 198 +++++++++++++++++++++ 6 files changed, 489 insertions(+) create mode 100644 common/checkstyle/pom.xml create mode 100644 common/checkstyle/src/main/resources/HONEYCOMB_LICENSE.txt create mode 100644 common/checkstyle/src/main/resources/README.adoc create mode 100644 common/checkstyle/src/main/resources/honeycomb-checkstyle-logging.xml create mode 100644 common/checkstyle/src/main/resources/honeycomb-checkstyle.xml create mode 100644 common/checkstyle/src/main/resources/intellij-java-coding-style.xml (limited to 'common/checkstyle') diff --git a/common/checkstyle/pom.xml b/common/checkstyle/pom.xml new file mode 100644 index 000000000..8580e89e0 --- /dev/null +++ b/common/checkstyle/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + + org.opendaylight.odlparent + odlparent-lite + 1.6.2-Beryllium-SR2 + + + + io.fd.honeycomb.common + honeycomb-checkstyle + 1.0.0-SNAPSHOT + + diff --git a/common/checkstyle/src/main/resources/HONEYCOMB_LICENSE.txt b/common/checkstyle/src/main/resources/HONEYCOMB_LICENSE.txt new file mode 100644 index 000000000..9c84910ae --- /dev/null +++ b/common/checkstyle/src/main/resources/HONEYCOMB_LICENSE.txt @@ -0,0 +1,15 @@ +^/[*]+$ +^ \* Copyright (\([cC]\)|©) [0-9]{4}(, [0-9]{4})? .*$ +^ \*( )?$ +^ \* 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: +^ \* +^ \* http://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. +^ [*]+/$ \ No newline at end of file diff --git a/common/checkstyle/src/main/resources/README.adoc b/common/checkstyle/src/main/resources/README.adoc new file mode 100644 index 000000000..d33f39efc --- /dev/null +++ b/common/checkstyle/src/main/resources/README.adoc @@ -0,0 +1,6 @@ += Honeycomb coding resources + +* intellij-java-coding-style.xml Can be imported into Intellij IDEA to ensure Honeycomb coding style during development +* checkstyle.xml Checkstyle config ensuring above HOneycomb coding style +* checkstyle-license.xml Checkstyle config ensuring Honeycomb license (in HONEYCOMB_LICENSE.txt) header presence +* checkstyle-logging.xml Checkstyle config ensuring ODL logging standards \ No newline at end of file diff --git a/common/checkstyle/src/main/resources/honeycomb-checkstyle-logging.xml b/common/checkstyle/src/main/resources/honeycomb-checkstyle-logging.xml new file mode 100644 index 000000000..79bdbfd7a --- /dev/null +++ b/common/checkstyle/src/main/resources/honeycomb-checkstyle-logging.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/checkstyle/src/main/resources/honeycomb-checkstyle.xml b/common/checkstyle/src/main/resources/honeycomb-checkstyle.xml new file mode 100644 index 000000000..794606cbe --- /dev/null +++ b/common/checkstyle/src/main/resources/honeycomb-checkstyle.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/checkstyle/src/main/resources/intellij-java-coding-style.xml b/common/checkstyle/src/main/resources/intellij-java-coding-style.xml new file mode 100644 index 000000000..06a3a21ec --- /dev/null +++ b/common/checkstyle/src/main/resources/intellij-java-coding-style.xml @@ -0,0 +1,198 @@ + + + + \ No newline at end of file -- cgit 1.2.3-korg