mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Add nohttp checkstyle rule
Closes gh-16682
This commit is contained in:
parent
72268a266b
commit
80d8a5cfa2
@ -17,7 +17,7 @@
|
||||
<url>https://www.spring.io</url>
|
||||
</organization>
|
||||
<properties>
|
||||
<main.basedir>..</main.basedir>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<disable.checks>false</disable.checks>
|
||||
<java.version>1.6</java.version>
|
||||
<aether.version>1.0.2.v20150114</aether.version>
|
||||
@ -25,6 +25,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.version>3.1.1</maven.version>
|
||||
<spring-javaformat.version>0.0.9</spring-javaformat.version>
|
||||
<nohttp-checkstyle.version>0.0.1.RELEASE</nohttp-checkstyle.version>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>https://github.com/spring-projects/spring-boot</url>
|
||||
@ -318,6 +319,11 @@
|
||||
<artifactId>spring-javaformat-checkstyle</artifactId>
|
||||
<version>${spring-javaformat.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.spring.nohttp</groupId>
|
||||
<artifactId>nohttp-checkstyle</artifactId>
|
||||
<version>${nohttp-checkstyle.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -533,6 +539,8 @@
|
||||
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
|
||||
<suppressionsLocation>src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
|
||||
<resourceIncludes>**\/*.*</resourceIncludes>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
<suppressions>
|
||||
<suppress files="[\\/]target[\\/]" checks=".*" />
|
||||
<suppress files=".+\.[jar|git|ico|p12]" checks=".*" />
|
||||
<suppress files="SpringApplicationTests\.java" checks="FinalClass" />
|
||||
<suppress files=".+Configuration\.java" checks="HideUtilityClassConstructor" />
|
||||
<suppress files=".+Application\.java" checks="HideUtilityClassConstructor" />
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "https://checkstyle.org/dtds/configuration_1_2.dtd">
|
||||
<module name="com.puppycrawl.tools.checkstyle.Checker">
|
||||
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
|
||||
<property name="whitelistFileName" value="${main.basedir}/spring-boot-parent/src/checkstyle/nohttp-whitelist.txt"/>
|
||||
</module>
|
||||
<module name="io.spring.javaformat.checkstyle.SpringChecks" />
|
||||
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
|
||||
|
1
spring-boot-parent/src/checkstyle/nohttp-whitelist.txt
Normal file
1
spring-boot-parent/src/checkstyle/nohttp-whitelist.txt
Normal file
@ -0,0 +1 @@
|
||||
^http://livereload.com/protocols/official-7$
|
@ -20,6 +20,7 @@
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-javaformat.version>0.0.9</spring-javaformat.version>
|
||||
<nohttp-checkstyle.version>0.0.1.RELEASE</nohttp-checkstyle.version>
|
||||
<disable.checks>false</disable.checks>
|
||||
</properties>
|
||||
<modules>
|
||||
@ -155,6 +156,11 @@
|
||||
<artifactId>spring-javaformat-checkstyle</artifactId>
|
||||
<version>${spring-javaformat.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.spring.nohttp</groupId>
|
||||
<artifactId>nohttp-checkstyle</artifactId>
|
||||
<version>${nohttp-checkstyle.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
@ -165,6 +171,8 @@
|
||||
<configLocation>../spring-boot-parent/src/checkstyle/checkstyle.xml</configLocation>
|
||||
<suppressionsLocation>../spring-boot-parent/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
|
||||
<resourceIncludes>**\/*.*</resourceIncludes>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
|
Loading…
Reference in New Issue
Block a user