Skip to content

Commit 951ca69

Browse files
let checkstyle see SuppressWarnings
1 parent 87bc278 commit 951ca69

File tree

3 files changed

+119
-11
lines changed

3 files changed

+119
-11
lines changed

api/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
</execution>
138138
</executions>
139139
</plugin>
140-
141140
</plugins>
142141
</pluginManagement>
143142
</build>

api/src/main/java/org/eclipse/microprofile/openapi/models/PathItem.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ default PathItem description(String description) {
120120
* definition of a GET operation
121121
* @return the current PathItem instance
122122
**/
123+
// CHECKSTYLE:OFF
124+
@SuppressWarnings("checkstyle:methodname")
123125
default PathItem GET(Operation get) {
124126
setGET(get);
125127
return this;
126128
}
129+
// CHECKSTYLE:ON
127130

128131
/**
129132
* Returns the put property from a PathItem instance.
@@ -147,6 +150,7 @@ default PathItem GET(Operation get) {
147150
* definition of a PUT operation
148151
* @return the current PathItem instance
149152
**/
153+
@SuppressWarnings("checkstyle:methodname")
150154
default PathItem PUT(Operation put) {
151155
setPUT(put);
152156
return this;
@@ -174,6 +178,7 @@ default PathItem PUT(Operation put) {
174178
* definition of a PUT operation
175179
* @return the current PathItem instance
176180
**/
181+
@SuppressWarnings("checkstyle:methodname")
177182
default PathItem POST(Operation post) {
178183
setPOST(post);
179184
return this;
@@ -201,6 +206,7 @@ default PathItem POST(Operation post) {
201206
* definition of a DELETE operation
202207
* @return the current PathItem instance
203208
**/
209+
@SuppressWarnings("checkstyle:methodname")
204210
default PathItem DELETE(Operation delete) {
205211
setDELETE(delete);
206212
return this;
@@ -228,6 +234,7 @@ default PathItem DELETE(Operation delete) {
228234
* definition of an OPTIONS operation
229235
* @return the current PathItem instance
230236
**/
237+
@SuppressWarnings("checkstyle:methodname")
231238
default PathItem OPTIONS(Operation options) {
232239
setOPTIONS(options);
233240
return this;
@@ -255,6 +262,7 @@ default PathItem OPTIONS(Operation options) {
255262
* definition of a HEAD operation
256263
* @return the current PathItem instance
257264
**/
265+
@SuppressWarnings("checkstyle:methodname")
258266
default PathItem HEAD(Operation head) {
259267
setHEAD(head);
260268
return this;
@@ -282,6 +290,7 @@ default PathItem HEAD(Operation head) {
282290
* definition of a PATCH operation
283291
* @return the current PathItem instance
284292
**/
293+
@SuppressWarnings("checkstyle:methodname")
285294
default PathItem PATCH(Operation patch) {
286295
setPATCH(patch);
287296
return this;
@@ -309,6 +318,7 @@ default PathItem PATCH(Operation patch) {
309318
* definition of a TRACE operation
310319
* @return the current PathItem instance
311320
**/
321+
@SuppressWarnings("checkstyle:methodname")
312322
default PathItem TRACE(Operation trace) {
313323
setTRACE(trace);
314324
return this;
@@ -420,4 +430,4 @@ default PathItem parameters(List<Parameter> parameters) {
420430
**/
421431
void removeParameter(Parameter parameter);
422432

423-
}
433+
}

tck/pom.xml

Lines changed: 108 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,114 @@
123123
</dependencies>
124124

125125
<build>
126-
<plugins>
127-
<plugin>
128-
<groupId>net.revelc.code.formatter</groupId>
129-
<artifactId>formatter-maven-plugin</artifactId>
130-
<configuration>
131-
<configFile>${project.basedir}/formatter.xml</configFile>
132-
</configuration>
133-
</plugin>
134-
</plugins>
126+
<pluginManagement>
127+
<plugins>
128+
<plugin>
129+
<groupId>net.revelc.code.formatter</groupId>
130+
<artifactId>formatter-maven-plugin</artifactId>
131+
<configuration>
132+
<configFile>${project.basedir}/formatter.xml</configFile>
133+
</configuration>
134+
</plugin>
135+
<plugin>
136+
<groupId>org.apache.maven.plugins</groupId>
137+
<artifactId>maven-checkstyle-plugin</artifactId>
138+
<version>${version.plugin.checkstyle}</version>
139+
<configuration>
140+
<skip>${skipChecks}</skip>
141+
<inputEncoding>UTF-8</inputEncoding>
142+
<sourceDirectories>
143+
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
144+
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
145+
</sourceDirectories>
146+
<failOnViolation>false</failOnViolation>
147+
<failsOnError>false</failsOnError>
148+
<linkXRef>true</linkXRef>
149+
<consoleOutput>true</consoleOutput>
150+
<logViolationsToConsole>true</logViolationsToConsole>
151+
<checkstyleRules>
152+
<module name="Checker">
153+
<module name="LineLength">
154+
<property name="max" value="150" />
155+
<!--suppress UnresolvedMavenProperty -->
156+
<property name="ignorePattern" value="@version|@see" />
157+
</module>
158+
<module name="FileLength">
159+
<property name="max" value="3500" />
160+
<property name="fileExtensions" value="java" />
161+
</module>
162+
<module name="FileTabCharacter" />
163+
<module name="TreeWalker">
164+
<module name="ConstantName">
165+
<property name="format" value="^(([A-Z][A-Z0-9]*(_[A-Z0-9]+)*))$" />
166+
</module>
167+
<module name="LocalVariableName" />
168+
<module name="MethodName">
169+
<property name="format" value="^_?[a-z][a-zA-Z0-9_]*$" />
170+
</module>
171+
<module name="PackageName" />
172+
<module name="LocalFinalVariableName" />
173+
<module name="ParameterName" />
174+
<module name="StaticVariableName" />
175+
176+
<module name="TypeName">
177+
<property name="format" value="^_?[A-Z][a-zA-Z0-9]*$|packageinfo" />
178+
</module>
179+
<module name="AvoidStarImport">
180+
<property name="excludes" value="java.io,java.net,java.util,javax.enterprise.inject.spi" />
181+
</module>
182+
<module name="IllegalImport" />
183+
<module name="RedundantImport" />
184+
<module name="UnusedImports" />
185+
<module name="MethodLength">
186+
<property name="max" value="250" />
187+
</module>
188+
<module name="ParameterNumber">
189+
<property name="max" value="11" />
190+
</module>
191+
<module name="EmptyBlock">
192+
<property name="option" value="text" />
193+
</module>
194+
<module name="NeedBraces" />
195+
<module name="LeftCurly">
196+
<property name="option" value="EOL" />
197+
</module>
198+
<module name="RightCurly" />
199+
<module name="EmptyStatement" />
200+
<module name="EqualsHashCode" />
201+
<module name="DefaultComesLast" />
202+
<module name="MissingSwitchDefault" />
203+
<module name="FallThrough" />
204+
<module name="MultipleVariableDeclarations" />
205+
<module name="com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck">
206+
<property name="severity" value="ignore" />
207+
</module>
208+
<module name="HideUtilityClassConstructor" />
209+
<module name="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck">
210+
<property name="packageAllowed" value="false" />
211+
<property name="protectedAllowed" value="true" />
212+
<property name="publicMemberPattern" value="^serialVersionUID" />
213+
<property name="severity" value="warning" />
214+
</module>
215+
<module name="UpperEll" />
216+
<module name="SuppressWarningsHolder" />
217+
</module>
218+
<module name="SuppressWarningsFilter" />
219+
</module>
220+
</checkstyleRules>
221+
</configuration>
222+
<executions>
223+
<execution>
224+
<id>verify-style</id>
225+
<phase>process-test-classes</phase>
226+
<goals>
227+
<goal>check</goal>
228+
</goals>
229+
</execution>
230+
</executions>
231+
</plugin>
232+
</plugins>
233+
</pluginManagement>
135234
</build>
136235

137236
</project>

0 commit comments

Comments
 (0)