chore: add checkstyle rule (#2091)

* feat: add unused imports checkstyle rule

* feat: add java doc style rule

* fix: check style
pull/2086/head^2
guqing 2022-05-17 14:46:11 +08:00 committed by GitHub
parent 3cf2f9d7e1
commit be2c0654a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 30 additions and 27 deletions

View File

@ -61,6 +61,7 @@
<property name="allowByTailComment" value="true"/> <property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/> <property name="allowNonPrintableEscapes" value="true"/>
</module> </module>
<module name="UnusedImports"/>
<module name="AvoidStarImport"/> <module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/> <module name="OneTopLevelClass"/>
<module name="NoLineWrap"> <module name="NoLineWrap">
@ -325,6 +326,7 @@
<property name="target" <property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module> </module>
<module name="JavadocStyle"/>
<module name="JavadocMethod"> <module name="JavadocMethod">
<property name="allowMissingParamTags" value="true"/> <property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/> <property name="allowMissingReturnTag" value="true"/>

View File

@ -18,7 +18,7 @@ public final class ProviderSettings extends AbstractSettings {
} }
/** /**
* Returns the URL of the Provider's Issuer Identifier * Returns the URL of the Provider's Issuer Identifier.
* *
* @return the URL of the Provider's Issuer Identifier * @return the URL of the Provider's Issuer Identifier
*/ */

View File

@ -23,7 +23,7 @@ public class BearerTokenAuthentication
private final Map<String, Object> attributes; private final Map<String, Object> attributes;
/** /**
* Constructs a {@link BearerTokenAuthentication} with the provided arguments * Constructs a {@link BearerTokenAuthentication} with the provided arguments.
* *
* @param principal The OAuth 2.0 attributes * @param principal The OAuth 2.0 attributes
* @param credentials The verified token * @param credentials The verified token

View File

@ -58,7 +58,7 @@ public class BearerTokenAuthenticationEntryPoint implements AuthenticationEntryP
} }
/** /**
* Set the default realm name to use in the bearer token error response * Set the default realm name to use in the bearer token error response.
* *
* @param realmName realm name * @param realmName realm name
*/ */

View File

@ -60,7 +60,7 @@ public class BearerTokenAuthenticationFilter extends OncePerRequestFilter {
new NullSecurityContextRepository(); new NullSecurityContextRepository();
/** /**
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s) * Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s).
* *
* @param authenticationManagerResolver authentication manager resolver * @param authenticationManagerResolver authentication manager resolver
*/ */
@ -72,7 +72,7 @@ public class BearerTokenAuthenticationFilter extends OncePerRequestFilter {
} }
/** /**
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s) * Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s).
* *
* @param authenticationManager authentication manager * @param authenticationManager authentication manager
*/ */

View File

@ -16,7 +16,7 @@ public class BearerTokenAuthenticationToken extends AbstractAuthenticationToken
private final String token; private final String token;
/** /**
* Create a {@code BearerTokenAuthenticationToken} using the provided parameter(s) * Create a {@code BearerTokenAuthenticationToken} using the provided parameter(s).
* *
* @param token - the bearer token * @param token - the bearer token
*/ */
@ -28,7 +28,7 @@ public class BearerTokenAuthenticationToken extends AbstractAuthenticationToken
/** /**
* Get the * Get the
* <a href="https://tools.ietf.org/html/rfc6750#section-1.2">Bearer Token</a> * <a href="https://tools.ietf.org/html/rfc6750#section-1.2">Bearer Token</a>.
* *
* @return the token that proves the caller's authority to perform the * @return the token that proves the caller's authority to perform the
* {@link jakarta.servlet.http.HttpServletRequest} * {@link jakarta.servlet.http.HttpServletRequest}

View File

@ -22,7 +22,7 @@ public final class BearerTokenError extends OAuth2Error {
private final String scope; private final String scope;
/** /**
* Create a {@code BearerTokenError} using the provided parameters * Create a {@code BearerTokenError} using the provided parameters.
* *
* @param errorCode the error code * @param errorCode the error code
* @param httpStatus the HTTP status * @param httpStatus the HTTP status
@ -33,7 +33,7 @@ public final class BearerTokenError extends OAuth2Error {
} }
/** /**
* Create a {@code BearerTokenError} using the provided parameters * Create a {@code BearerTokenError} using the provided parameters.
* *
* @param errorCode the error code * @param errorCode the error code
* @param httpStatus the HTTP status * @param httpStatus the HTTP status

View File

@ -4,7 +4,7 @@ import org.springframework.http.HttpStatus;
/** /**
* A factory for creating {@link BearerTokenError} instances that correspond to the * A factory for creating {@link BearerTokenError} instances that correspond to the
* registered <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error Codes</a> * registered <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error Codes</a>.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0
@ -24,7 +24,7 @@ public class BearerTokenErrors {
} }
/** /**
* Create a {@link BearerTokenError} caused by an invalid request * Create a {@link BearerTokenError} caused by an invalid request.
* *
* @param message a description of the error * @param message a description of the error
* @return a {@link BearerTokenError} * @return a {@link BearerTokenError}
@ -42,7 +42,7 @@ public class BearerTokenErrors {
} }
/** /**
* Create a {@link BearerTokenError} caused by an invalid token * Create a {@link BearerTokenError} caused by an invalid token.
* *
* @param message a description of the error * @param message a description of the error
* @return a {@link BearerTokenError} * @return a {@link BearerTokenError}
@ -60,7 +60,7 @@ public class BearerTokenErrors {
} }
/** /**
* Create a {@link BearerTokenError} caused by an invalid token * Create a {@link BearerTokenError} caused by an invalid token.
* *
* @param scope the scope attribute to use in the error * @param scope the scope attribute to use in the error
* @return a {@link BearerTokenError} * @return a {@link BearerTokenError}

View File

@ -61,7 +61,7 @@ public class JwtAuthenticationToken extends AbstractOAuth2TokenAuthenticationTok
} }
/** /**
* The principal name which is, by default, the {@link Jwt}'s subject * The principal name which is, by default, the {@link Jwt}'s subject.
*/ */
@Override @Override
public String getName() { public String getName() {

View File

@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* authorizing visitor short-circuits once allowed, and collects any resolution errors encountered * authorizing visitor short-circuits once allowed, and collects any resolution errors encountered.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0

View File

@ -15,11 +15,12 @@ public class RequestInfoFactory {
new RequestInfoFactory(Set.of("api", "apis"), Set.of("api")); new RequestInfoFactory(Set.of("api", "apis"), Set.of("api"));
/** /**
* without leading and trailing slashes * without leading and trailing slashes.
*/ */
final Set<String> apiPrefixes; final Set<String> apiPrefixes;
/** /**
* without leading and trailing slashes * without leading and trailing slashes.
*/ */
final Set<String> grouplessApiPrefixes; final Set<String> grouplessApiPrefixes;

View File

@ -3,7 +3,7 @@ package run.halo.app.identity.authorization;
import lombok.Data; import lombok.Data;
/** /**
* RoleRef contains information that points to the role being used * RoleRef contains information that points to the role being used.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0
@ -12,17 +12,17 @@ import lombok.Data;
public class RoleRef { public class RoleRef {
/** /**
* Kind is the type of resource being referenced * Kind is the type of resource being referenced.
*/ */
String kind; String kind;
/** /**
* Name is the name of resource being referenced * Name is the name of resource being referenced.
*/ */
String name; String name;
/** /**
* APIGroup is the group for the resource being referenced * APIGroup is the group for the resource being referenced.
*/ */
String apiGroup; String apiGroup;
} }

View File

@ -22,7 +22,7 @@ import org.springframework.security.oauth2.core.OAuth2TokenIntrospectionClaimNam
import run.halo.app.identity.authentication.verifier.BearerTokenAuthentication; import run.halo.app.identity.authentication.verifier.BearerTokenAuthentication;
/** /**
* Tests for {@link BearerTokenAuthentication} * Tests for {@link BearerTokenAuthentication}.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0

View File

@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test;
import run.halo.app.identity.authentication.verifier.BearerTokenAuthenticationToken; import run.halo.app.identity.authentication.verifier.BearerTokenAuthenticationToken;
/** /**
* Tests for {@link BearerTokenAuthenticationToken} * Tests for {@link BearerTokenAuthenticationToken}.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0

View File

@ -8,7 +8,7 @@ import org.springframework.http.HttpStatus;
import run.halo.app.identity.authentication.verifier.BearerTokenError; import run.halo.app.identity.authentication.verifier.BearerTokenError;
/** /**
* Tests for {@link BearerTokenError} * Tests for {@link BearerTokenError}.
* *
* @author guqing * @author guqing
* @see <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error</a> * @see <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error</a>

View File

@ -9,7 +9,7 @@ import run.halo.app.identity.authentication.verifier.BearerTokenErrorCodes;
import run.halo.app.identity.authentication.verifier.BearerTokenErrors; import run.halo.app.identity.authentication.verifier.BearerTokenErrors;
/** /**
* Tests for {@link BearerTokenErrors} * Tests for {@link BearerTokenErrors}.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0

View File

@ -26,7 +26,7 @@ import run.halo.app.identity.authentication.verifier.JwtAuthenticationProvider;
import run.halo.app.identity.authentication.verifier.JwtAuthenticationToken; import run.halo.app.identity.authentication.verifier.JwtAuthenticationToken;
/** /**
* Tests for {@link JwtAuthenticationProvider} * Tests for {@link JwtAuthenticationProvider}.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0

View File

@ -13,7 +13,7 @@ import org.springframework.security.oauth2.jwt.Jwt;
import run.halo.app.identity.authentication.verifier.JwtGrantedAuthoritiesConverter; import run.halo.app.identity.authentication.verifier.JwtGrantedAuthoritiesConverter;
/** /**
* Tests for {@link JwtGrantedAuthoritiesConverter} * Tests for {@link JwtGrantedAuthoritiesConverter}.
* *
* @author guqing * @author guqing
* @since 2.0.0 * @since 2.0.0