Skip to content

Commit aad1478

Browse files
alesjEricWittmann
authored andcommitted
Add simple checkstyle rules. (#169)
1 parent 797ae71 commit aad1478

File tree

6 files changed

+76
-22
lines changed

6 files changed

+76
-22
lines changed

.checkstyle/simple.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
8+
<module name="TreeWalker">
9+
10+
<!-- code cleanup -->
11+
<module name="UnusedImports">
12+
<property name="processJavadoc" value="true"/>
13+
</module>
14+
<module name="RedundantImport"/>
15+
</module>
16+
17+
</module>
18+

client/src/main/java/io/apicurio/registry/client/CachedRegistryService.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616

1717
package io.apicurio.registry.client;
1818

19+
import io.apicurio.registry.rest.beans.ArtifactMetaData;
20+
import io.apicurio.registry.rest.beans.EditableMetaData;
21+
import io.apicurio.registry.rest.beans.Rule;
22+
import io.apicurio.registry.rest.beans.VersionMetaData;
23+
import io.apicurio.registry.types.ArtifactType;
24+
import io.apicurio.registry.types.RuleType;
25+
import io.apicurio.registry.utils.IoUtil;
26+
1927
import java.io.InputStream;
2028
import java.util.Collections;
2129
import java.util.List;
@@ -30,14 +38,6 @@
3038
import javax.ws.rs.Path;
3139
import javax.ws.rs.core.Response;
3240

33-
import io.apicurio.registry.rest.beans.ArtifactMetaData;
34-
import io.apicurio.registry.rest.beans.EditableMetaData;
35-
import io.apicurio.registry.rest.beans.Rule;
36-
import io.apicurio.registry.rest.beans.VersionMetaData;
37-
import io.apicurio.registry.types.ArtifactType;
38-
import io.apicurio.registry.types.RuleType;
39-
import io.apicurio.registry.utils.IoUtil;
40-
4141
/**
4242
* @author Ales Justin
4343
*/

pom.xml

+41
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@
131131
<version.source.plugin>3.2.0</version.source.plugin>
132132
<version.surefire.plugin>2.22.2</version.surefire.plugin>
133133
<version.jar.plugin>3.2.0</version.jar.plugin>
134+
<version.checkstyle.plugin>3.1.0</version.checkstyle.plugin>
134135
<version.properties.plugin>1.0.0</version.properties.plugin>
135136
<version.dependency.plugin>3.1.1</version.dependency.plugin>
137+
<!-- Plugin Deps -->
138+
<version.puppycrawl>8.26</version.puppycrawl>
136139
<!-- Proto -->
137140
<proto-plugin.version>0.6.1</proto-plugin.version>
138141
<os-maven-plugin.version>1.6.2</os-maven-plugin.version>
@@ -316,6 +319,11 @@
316319
<artifactId>maven-jar-plugin</artifactId>
317320
<version>${version.jar.plugin}</version>
318321
</plugin>
322+
<plugin>
323+
<groupId>org.apache.maven.plugins</groupId>
324+
<artifactId>maven-checkstyle-plugin</artifactId>
325+
<version>${version.checkstyle.plugin}</version>
326+
</plugin>
319327
<plugin>
320328
<groupId>org.jboss.jandex</groupId>
321329
<artifactId>jandex-maven-plugin</artifactId>
@@ -407,6 +415,39 @@
407415
<failOnWarnings>false</failOnWarnings>
408416
</configuration>
409417
</plugin>
418+
<plugin>
419+
<groupId>org.apache.maven.plugins</groupId>
420+
<artifactId>maven-checkstyle-plugin</artifactId>
421+
<dependencies>
422+
<dependency>
423+
<groupId>com.puppycrawl.tools</groupId>
424+
<artifactId>checkstyle</artifactId>
425+
<version>${version.puppycrawl}</version>
426+
</dependency>
427+
</dependencies>
428+
<executions>
429+
<execution>
430+
<id>validate</id>
431+
<phase>validate</phase>
432+
<configuration>
433+
<configLocation>.checkstyle/simple.xml
434+
</configLocation>
435+
<headerLocation>.checkstyle/java.header
436+
</headerLocation>
437+
<suppressionsLocation>.checkstyle/suppressions.xml
438+
</suppressionsLocation>
439+
<includeTestSourceDirectory>true
440+
</includeTestSourceDirectory>
441+
<encoding>UTF-8</encoding>
442+
<consoleOutput>true</consoleOutput>
443+
<failsOnError>true</failsOnError>
444+
</configuration>
445+
<goals>
446+
<goal>check</goal>
447+
</goals>
448+
</execution>
449+
</executions>
450+
</plugin>
410451
</plugins>
411452
</build>
412453

tests/pom.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<vertx.version>3.8.4</vertx.version>
2323
<scala.version>2.12.10</scala.version>
2424
<maven.dependency.version>3.1.1</maven.dependency.version>
25-
<maven.checkstyle.version>3.0.0</maven.checkstyle.version>
2625
<log4j.version>1.7.28</log4j.version>
2726
<hamcrest.version>2.2</hamcrest.version>
2827
</properties>
@@ -184,12 +183,11 @@
184183
<plugin>
185184
<groupId>org.apache.maven.plugins</groupId>
186185
<artifactId>maven-checkstyle-plugin</artifactId>
187-
<version>${maven.checkstyle.version}</version>
188186
<dependencies>
189187
<dependency>
190188
<groupId>com.puppycrawl.tools</groupId>
191189
<artifactId>checkstyle</artifactId>
192-
<version>8.18</version>
190+
<version>${version.puppycrawl}</version>
193191
</dependency>
194192
</dependencies>
195193
<executions>

utils/serde/src/main/java/io/apicurio/registry/utils/serde/AvroKafkaDeserializer.java

+8-10
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@
1616

1717
package io.apicurio.registry.utils.serde;
1818

19+
import io.apicurio.registry.client.RegistryService;
20+
import io.apicurio.registry.utils.serde.avro.AvroDatumProvider;
21+
import io.apicurio.registry.utils.serde.avro.AvroSchemaUtils;
22+
import io.apicurio.registry.utils.serde.avro.DefaultAvroDatumProvider;
23+
import org.apache.avro.Schema;
24+
import org.apache.avro.io.DatumReader;
25+
import org.apache.avro.io.DecoderFactory;
26+
1927
import java.io.IOException;
2028
import java.io.UncheckedIOException;
2129
import java.nio.ByteBuffer;
2230
import java.util.Map;
2331
import java.util.Objects;
2432
import java.util.function.Consumer;
25-
2633
import javax.ws.rs.core.Response;
2734

28-
import org.apache.avro.Schema;
29-
import org.apache.avro.io.DatumReader;
30-
import org.apache.avro.io.DecoderFactory;
31-
32-
import io.apicurio.registry.client.RegistryService;
33-
import io.apicurio.registry.utils.serde.avro.AvroDatumProvider;
34-
import io.apicurio.registry.utils.serde.avro.AvroSchemaUtils;
35-
import io.apicurio.registry.utils.serde.avro.DefaultAvroDatumProvider;
36-
3735
/**
3836
* @author Ales Justin
3937
*/

utils/serde/src/main/java/io/apicurio/registry/utils/serde/strategy/TopicRecordIdStrategy.java

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.apicurio.registry.utils.serde.strategy;
1818

1919
import org.apache.avro.Schema;
20-
import org.apache.kafka.common.errors.SerializationException;
2120

2221
/**
2322
* @author Ales Justin

0 commit comments

Comments
 (0)