Skip to content

Upgrade checkstyle version #1132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.7</version>
<version>8.18</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil;
import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;
import java.util.Arrays;
import java.util.List;

Expand Down Expand Up @@ -50,7 +50,7 @@ public int[] getRequiredTokens() {

@Override
public void visitToken(DetailAST ast) {
if (!ScopeUtils.isOuterMostType(ast) || SDK_ANNOTATIONS.stream().anyMatch(a -> AnnotationUtility.containsAnnotation
if (!ScopeUtil.isOuterMostType(ast) || SDK_ANNOTATIONS.stream().anyMatch(a -> AnnotationUtil.containsAnnotation
(ast, a))) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck;
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil;

/**
* Sdk Method Name check to check only public methods in the classes with {@code @SdkPublicApi} annotation.
Expand Down Expand Up @@ -55,8 +55,8 @@ public void visitToken(DetailAST ast) {
DetailAST classDef = ast.getParent().getParent();

try {
if (!AnnotationUtility.containsAnnotation(ast, OVERRIDE)
&& AnnotationUtility.containsAnnotation(classDef, SDK_PUBLIC_API)) {
if (!AnnotationUtil.containsAnnotation(ast, OVERRIDE)
&& AnnotationUtil.containsAnnotation(classDef, SDK_PUBLIC_API)) {
super.visitToken(ast);
}
} catch (NullPointerException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;

/**
* A rule that disallows unnecessary 'final' on local variables
Expand All @@ -42,8 +42,8 @@ public int[] getRequiredTokens() {

@Override
public void visitToken(DetailAST ast) {
if (ScopeUtils.isLocalVariableDef(ast) && ast.findFirstToken(TokenTypes.MODIFIERS)
.findFirstToken(TokenTypes.FINAL) != null) {
if (ScopeUtil.isLocalVariableDef(ast) && ast.findFirstToken(TokenTypes.MODIFIERS)
.findFirstToken(TokenTypes.FINAL) != null) {
log(ast, "final should be removed from local variable");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
default="checkstyle-suppressions.xml"/>
</module>

<!-- Allow suppressing rules via comments. -->
<module name="SuppressionCommentFilter"/>

<module name="TreeWalker">
<!-- Make the file contents available to the tree walker, so that we can check comments for rule suppression. -->
<module name="FileContentsHolder"/>

<!-- Allow suppressing rules via comments. -->
<module name="SuppressionCommentFilter"/>

<!-- Class names must match the file name in which they are defined. -->
<module name="OuterTypeFilename"/>
Expand Down Expand Up @@ -89,11 +87,6 @@
<!-- Braces must be used for all blocks. -->
<module name="NeedBraces"/>

<!-- Left curly braces cannot be placed on the next line. -->
<module name="LeftCurly">
<property name="maxLineLength" value="130"/>
</module>

<!-- Braces must not be empty for most language constructs. -->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
Expand Down Expand Up @@ -314,14 +307,6 @@
<!-- There must be no space between a method name and its parameter list. -->
<module name="ParenPad"/>

<!--&lt;!&ndash; Operators in multi-line statements must be placed at the beginning, not end, of the lines. &ndash;&gt;-->
<!--<module name="OperatorWrap">-->
<!--<property name="option" value="NL"/>-->
<!--<property name="tokens"-->
<!--value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>-->
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
<!--</module>-->

<!-- Non-field annotations must be on separate lines, or in the case of single parameterless annotation can be
placed on the same line as the signature. -->
<module name="AnnotationLocation">
Expand All @@ -336,45 +321,6 @@
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>

<!-- Javadoc @param, @return, etc. must not be empty (but may be excluded). -->
<module name="NonEmptyAtclauseDescription"/>

<!--&lt;!&ndash; Javadoc summaries must be a complete sentence, and must not say things like "This X" or "A X"... &ndash;&gt;-->
<!--<module name="SummaryJavadoc">-->
<!--<property name="forbiddenSummaryFragments"-->
<!--value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>-->
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
<!--</module>-->

<!--&lt;!&ndash; One blank line must exist between each javadoc paragraph, and each paragraph <p> must occur on the same-->
<!--line as the text. &ndash;&gt;-->
<!--<module name="JavadocParagraph">-->
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
<!--</module>-->

<!-- Javadoc @param, etc. must follow a specific order. -->
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>

<!--&lt;!&ndash; Javadoc must be specified for all public methods and follow a specific pattern. &ndash;&gt;-->
<!--<module name="JavadocMethod">-->
<!--<property name="scope" value="public"/>-->
<!--<property name="allowMissingParamTags" value="true"/>-->
<!--<property name="allowMissingThrowsTags" value="true"/>-->
<!--<property name="allowMissingReturnTag" value="true"/>-->
<!--<property name="minLineCount" value="2"/>-->
<!--<property name="allowedAnnotations" value="Override, Test"/>-->
<!--<property name="allowThrowsTagsForSubclasses" value="true"/>-->
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
<!--</module>-->

<!-- Single-line style javadoc may be used. -->
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>

<!-- Catch blocks must not be empty without a comment. -->
<module name="EmptyCatchBlock"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public ApiCallAttemptTimeoutTrackingStage(HttpClientDependencies dependencies, R
/**
* Start and end api call attempt timer around the execution of the api call attempt. It's important
* that the client execution task is canceled before the InterruptedException is handled by
* {@link #wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the callers code
* {@link ApiCallTimeoutTrackingStage#wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the
* callers code.
*/
@Override
public Response<OutputT> execute(SdkHttpFullRequest request, RequestExecutionContext context) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public Response<OutputT> execute(SdkHttpFullRequest request, RequestExecutionCon
/**
* Start and end client execution timer around the execution of the request. It's important
* that the client execution task is canceled before the InterruptedException is handled by
* {@link #wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the callers code
* {@link ApiCallTimeoutTrackingStage#wrapped#execute(SdkHttpFullRequest)} so the interrupt status
* doesn't leak out to the callers code
*/
private Response<OutputT> executeWithTimer(SdkHttpFullRequest request, RequestExecutionContext context) throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ private class ResponseHandler implements TransformingAsyncResponseHandler<Respon

/**
* @param responseFuture the response future to be returned from
* {@link #executeHttpRequest(SdkHttpFullRequest, RequestExecutionContext)}
* @param transformFuture the transformFuture returned from {@link #responseHandler#prepare()}
* @param errorTransformFuture the error transform future returned from {@link #errorResponseHandler#prepare()}
* {@link MakeAsyncHttpRequestStage#executeHttpRequest(SdkHttpFullRequest, RequestExecutionContext)}
* @param transformFuture the transformFuture returned from {@link MakeAsyncHttpRequestStage#responseHandler#prepare()}
* @param errorTransformFuture the error transform future returned from
* {@link MakeAsyncHttpRequestStage#errorResponseHandler#prepare()}
*/
ResponseHandler(CompletableFuture<Response<OutputT>> responseFuture,
CompletableFuture<OutputT> transformFuture,
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<checkstyle.version>7.8.2</checkstyle.version>
<checkstyle.version>8.18</checkstyle.version>
<jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
Expand Down