Added nohttp checkstyle; fixes gh-134

This commit is contained in:
Marcin Grzejszczak
2019-06-06 13:39:51 +02:00
parent 3f7f57b869
commit 80eece2100
2 changed files with 53 additions and 0 deletions

24
pom.xml
View File

@@ -83,9 +83,13 @@
<checkstyle.suppressions.file>
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/${spring-cloud-build-checkstyle.branch}/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml
</checkstyle.suppressions.file>
<checkstyle.nohttp.file>
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/${spring-cloud-build-checkstyle.branch}/spring-cloud-build-tools/src/checkstyle/nohttp-checkstyle.xml
</checkstyle.nohttp.file>
<checkstyle.additional.suppressions.file>
${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle-suppressions.xml
</checkstyle.additional.suppressions.file>
<nohttp-checkstyle.version>0.0.1.BUILD-SNAPSHOT</nohttp-checkstyle.version>
</properties>
<dependencyManagement>
<dependencies>
@@ -406,6 +410,11 @@
<artifactId>spring-cloud-build-tools</artifactId>
<version>${spring-cloud-build.version}</version>
</dependency>
<dependency>
<groupId>io.spring.nohttp</groupId>
<artifactId>nohttp-checkstyle</artifactId>
<version>${nohttp-checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
@@ -436,6 +445,21 @@
<goal>check</goal>
</goals>
</execution>
<execution>
<id>no-http-checkstyle-validation</id>
<phase>validate</phase>
<inherited>true</inherited>
<configuration>
<skip>${disable.checks}</skip>
<configLocation>${checkstyle.nohttp.file}</configLocation>
<includes>**/*</includes>
<excludes>**/.git/**/*,**/target/**/*,**/*.log</excludes>
<sourceDirectories>./</sourceDirectories>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!--
~ Copyright 2002-2019 the original author or 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.
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Configure checker to use UTF-8 encoding -->
<property name="charset" value="UTF-8"/>
<!-- Configure checker to run on files with these extensions -->
<property name="fileExtensions" value=""/>
<!-- For detailed checkstyle configuration, see https://github.com/spring-io/nohttp/tree/master/nohttp-checkstyle -->
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
</module>
</module>