mirror of
https://gitee.com/dcren/initializr.git
synced 2025-04-05 17:38:06 +08:00
Add rule to prevent Spring conventions to be imported
See gh-871
This commit is contained in:
parent
738cf0f55b
commit
3818b5b05e
@ -9,6 +9,10 @@
|
||||
<artifactId>initializr-generator-spring</artifactId>
|
||||
<name>Spring Initializr :: Generator (Spring projects)</name>
|
||||
|
||||
<properties>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.spring.initializr</groupId>
|
||||
|
3
pom.xml
3
pom.xml
@ -193,8 +193,9 @@
|
||||
<phase>validate</phase>
|
||||
<configuration>
|
||||
<skip>${disable.checks}</skip>
|
||||
<configLocation>io/spring/javaformat/checkstyle/checkstyle.xml</configLocation>
|
||||
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
|
22
src/checkstyle/checkstyle.xml
Normal file
22
src/checkstyle/checkstyle.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
||||
<module name="com.puppycrawl.tools.checkstyle.Checker">
|
||||
<module name="io.spring.javaformat.checkstyle.SpringChecks"/>
|
||||
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
|
||||
<module
|
||||
name="com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck">
|
||||
<property name="file"
|
||||
value="${main.basedir}/src/checkstyle/import-control.xml"/>
|
||||
<property name="path" value="^.*[\\/]src[\\/]main[\\/].*$"/>
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
|
||||
<property name="maximum" value="0"/>
|
||||
<property name="format"
|
||||
value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)"/>
|
||||
<property name="message"
|
||||
value="Please use BDDMockito imports."/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
12
src/checkstyle/import-control.xml
Normal file
12
src/checkstyle/import-control.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE import-control PUBLIC "-//Puppy Crawl//DTD Import Control 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
|
||||
<import-control pkg="io.spring.initializr">
|
||||
<allow pkg=".*" regex="true"/>
|
||||
<subpackage name="web">
|
||||
<disallow pkg="io.spring.initializr.generator.spring"/>
|
||||
</subpackage>
|
||||
<subpackage name="actuate">
|
||||
<disallow pkg="io.spring.initializr.generator.spring"/>
|
||||
</subpackage>
|
||||
</import-control>
|
Loading…
Reference in New Issue
Block a user