Skip to content

Commit 23c278a

Browse files
committed
Add Checkstyle to avoid import statements that use the * notation.
1 parent 15c5799 commit 23c278a

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

301-quarkus-vertx-kafka/src/main/java/io/quarkus/qe/kafka/consumer/KStockPriceConsumer.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
import javax.enterprise.context.ApplicationScoped;
66
import javax.inject.Inject;
77

8-
import org.eclipse.microprofile.reactive.messaging.*;
8+
import org.eclipse.microprofile.reactive.messaging.Acknowledgment;
9+
import org.eclipse.microprofile.reactive.messaging.Channel;
10+
import org.eclipse.microprofile.reactive.messaging.Emitter;
11+
import org.eclipse.microprofile.reactive.messaging.Incoming;
12+
import org.eclipse.microprofile.reactive.messaging.OnOverflow;
13+
import org.eclipse.microprofile.reactive.messaging.Outgoing;
914
import org.jboss.logging.Logger;
1015

1116
import io.quarkus.qe.kafka.StockPrice;

checkstyle.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
2+
3+
<module name="Checker">
4+
<property name="severity" value="error"/>
5+
<module name="TreeWalker">
6+
<!-- Checks for imports -->
7+
<!-- See https://checkstyle.org/config_imports.html -->
8+
<module name="AvoidStarImport"/>
9+
<module name="RedundantImport"/>
10+
</module>
11+
</module>

pom.xml

+23
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<formatter-maven-plugin.version>2.15.0</formatter-maven-plugin.version>
5353
<impsort-maven-plugin.version>1.6.0</impsort-maven-plugin.version>
5454
<xml-format-maven-plugin>3.1.2</xml-format-maven-plugin>
55+
<maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
5556
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
5657
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
5758
<quarkus.platform.version>999-SNAPSHOT</quarkus.platform.version>
@@ -208,6 +209,28 @@
208209
</execution>
209210
</executions>
210211
</plugin>
212+
<plugin>
213+
<groupId>org.apache.maven.plugins</groupId>
214+
<artifactId>maven-checkstyle-plugin</artifactId>
215+
<version>${maven-checkstyle-plugin.version}</version>
216+
<configuration>
217+
<configLocation>checkstyle.xml</configLocation>
218+
<encoding>UTF-8</encoding>
219+
<consoleOutput>true</consoleOutput>
220+
<failsOnError>true</failsOnError>
221+
<linkXRef>true</linkXRef>
222+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
223+
</configuration>
224+
<executions>
225+
<execution>
226+
<id>validate</id>
227+
<phase>validate</phase>
228+
<goals>
229+
<goal>check</goal>
230+
</goals>
231+
</execution>
232+
</executions>
233+
</plugin>
211234
</plugins>
212235
</build>
213236
<profiles>

0 commit comments

Comments
 (0)