代码拉取完成,页面将自动刷新
同步操作将从 老寇云/KCloud-Platform-IoT 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?xml version="1.0"?>
<!--
/*
* Copyright (c) 2022-2024 KCloud-Platform-Alibaba Author or Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<!--字符集校验-->
<property name="charset" value="UTF-8"/>
<!--检查级别-->
<property name="severity" value="error"/>
<!-- 检查property文件中是否有相同的key -->
<module name="Translation"/>
<!-- <module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
<property name="optional" value="true"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.additional.suppressions.file}"/>
<property name="optional" value="true"/>
</module>
-->
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
<!-- TAKEN FROM SPRING BOOT -->
<!-- Root Checks -->
<!-- 自定义配置,参考: https://checkstyle.sourceforge.io/checks/javadoc/javadocstyle.html#JavadocStyle -->
<module name="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck">
<property name="headerFile" value="checkstyle-header.txt"/>
<!-- 限定检查的扩展类型 -->
<property name="fileExtensions" value="java"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"/>
<!-- 每行不超过1000个字符,默认为80 -->
<module name="LineLength">
<property name="fileExtensions" value="java" />
<!--可以忽略检查的行-->
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|@respbody" />
<property name="max" value="1000" />
</module>
<!-- 文件长度检查不要超过2500行 -->
<module name="FileLength">
<property name="max" value="2500"/>
</module>
<!--检查Warning警告-->
<module name="SuppressWarningsFilter"/>
<!-- TreeWalker Checks -->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<property name="tabWidth" value="1"/>
<!-- Spring Cloud ones -->
<!-- <module name="LineLength">
<property name="max" value="120"/>
</module> -->
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
<property name="illegalPkgs" value="com.google.common"/>
</module>
-->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="@checkstyle:off"/>
<property name="onCommentFormat" value="@checkstyle:on"/>
</module>
<!-- TAKEN FROM SPRING BOOT -->
<!-- Annotations -->
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck">
<property name="elementStyle" value="compact"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck">
<property name="allowSamelineSingleParameterlessAnnotation"
value="false"/>
</module>
<!-- 方法的参数个数不超过5个,默认为7个,并且不对构造方法进行检查-->
<module name="ParameterNumber">
<property name="max" value="10"/>
<property name="ignoreOverriddenMethods" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<!-- Block Checks -->
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck">
<property name="option" value="text"/>
</module>
<!-- 检查代码左括号 '{' 位置 -->
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck">
<property name="option" value="eol"/>
</module>
<!-- 检查代码右括号 '}' 位置 -->
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck">
<property name="id" value="RightCurlySame"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
</module>
-->
<!-- 检查代码块是否缺失{} -->
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck"/>
-->
<!--检查空catch块-->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignored"/>
</module>
<!-- 检查空的代码段 -->
<module name="EmptyStatement"/>
<!-- Class Design -->
<module name="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck"/>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck">
<!– 不标记接口 –>
<property name="allowMarkerInterfaces" value="false"/>
</module>
-->
<!-- 检查只有private构造函数的类是否声明为final -->
<module name="FinalClass"/>
<module name="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck"/>
<!--<module name="com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck" />-->
<!-- Coding -->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck"/>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"/>
-->
<!-- 检测字符串比较 -->
<module name="EqualsAvoidNull"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck">
<property name="max" value="3"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck">
<property name="max" value="3"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck">
<property name="max" value="3"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
<!--<module name="com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck">
<property name="checkMethods" value="false" />
<property name="validateOnlyOverlapping" value="false" />
</module>-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
<!-- Imports -->
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
-->
<!--<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck">-->
<!--<property name="excludes"-->
<!--value="io.restassured.RestAssured.*, org.assertj.core.api.Assertions.*, org.assertj.core.api.Assumptions.*, org.awaitility.Awaitility.*, org.junit.Assert.*, org.junit.Assume.*, org.junit.internal.matchers.ThrowableMessageMatcher.*, org.junit.jupiter.api.Assertions.*, org.hamcrest.CoreMatchers.*, org.hamcrest.Matchers.*, org.springframework.boot.configurationprocessor.ConfigurationMetadataMatchers.*, org.springframework.boot.configurationprocessor.TestCompiler.*, org.springframework.boot.test.autoconfigure.AutoConfigurationImportedCondition.*, org.mockito.Mockito.*, org.mockito.BDDMockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Matchers.*, org.springframework.restdocs.headers.HeaderDocumentation.*, org.springframework.restdocs.hypermedia.HypermediaDocumentation.*, org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*, org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*, org.springframework.restdocs.operation.preprocess.Preprocessors.*, org.springframework.restdocs.payload.PayloadDocumentation.*, org.springframework.restdocs.request.RequestDocumentation.*, org.springframework.restdocs.restassured3.operation.preprocess.RestAssuredPreprocessors.*, org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.*, org.springframework.restdocs.snippet.Attributes.*, org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.*, org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*, org.springframework.test.web.servlet.result.MockMvcResultMatchers.*, org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*, org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*, org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*, org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo, org.springframework.test.web.client.ExpectedCount.*, org.springframework.test.web.client.match.MockRestRequestMatchers.*, org.springframework.test.web.client.response.MockRestResponseCreators.*, org.springframework.test.web.servlet.result.MockMvcResultHandlers.*, org.springframework.web.reactive.function.BodyInserters.*, org.springframework.web.reactive.function.server.RequestPredicates.*, org.springframework.web.reactive.function.server.RouterFunctions.*, org.springframework.test.web.servlet.setup.MockMvcBuilders.*" />-->
<!--</module>-->
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck">
<property name="processJavadoc" value="true"/>
</module>
<!-- 检查局部变量或参数是否隐藏了类中的变量 -->
<!--
<module name="HiddenField">
<property name="tokens" value="VARIABLE_DEF"/>
</module>
-->
<!-- 检查是否使用工厂方法实例化 -->
<module name="IllegalInstantiation"/>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck">
<property name="groups" value="lombok,org,java,/^javax?\./,*"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="bottom"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
-->
<!-- Javadoc Comments -->
<!-- 注释检查 See http://checkstyle.sf.net/config_javadoc.html -->
<!-- 检查类和接口的javadoc 默认不检查author 和version tags
authorFormat: 检查author标签的格式
versionFormat: 检查version标签的格式
scope: 可以检查的类的范围,例如:public只能检查public修饰的类,private可以检查所有的类, 其它 protected,package,private,anoninner
excludeScope: 不能检查的类的范围,例如:public,public的类将不被检查,但访问权限小于public的类仍然会检查,其他的权限以此类推
tokens: 该属性适用的类型,例如:CLASS_DEF,INTERFACE_DEF
注:泛型也要注释,使用@param <T> 来说明-->
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
<property name="scope" value="private"/>
<property name="excludeScope" value="package"/>
<property name="authorFormat" value=".+\s.+"/>
<property name="tokens" value="CLASS_DEF,INTERFACE_DEF"/>
<property name="allowUnknownTags" value="true"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck">
<property name="scope" value="protected"/>
<property name="severity" value="ignore"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck">
<!-- 自定义配置,参考: https://checkstyle.sourceforge.io/checks/javadoc/javadocstyle.html#JavadocStyle -->
<!-- 解决“Checkstyle: Javadoc 首句应以句号结尾。” 使其支持中文标点符号 -->
<property name="checkFirstSentence" value="true"/>
<property name="endOfSentenceFormat" value="([.?!。?!][ \t\n\r\f<])|([.?!。?!]$)"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck">
<property name="offset" value="0"/>
</module>
<!-- 注意方法上的@param XXX后必须跟参数说明检查才能通过 -->
<!-- scope: 可以检查的方法的范围,例如:public只能检查public修饰的方法,private可以检查所有的方法
excludeScope: 不能检查的类的范围,例如:public,public的类将不被检查,但访问权限小于public的类仍然会检查,其他的权限以此类推
allowMissingParamTags: 是否忽略对参数注释的检查 默认为false
validateThrows: 是否忽略对throws注释的检查
allowMissingReturnTag: 是否忽略对return注释的检查 默认为false
tokens: 该属性适用的类型 比如 METHOD_DEF,ANNOTATION_FIELD_DEF -->
<module name="JavadocMethod">
<property name="tokens" value="METHOD_DEF" />
<property name="allowedAnnotations" value="Override, Test" />
<property name="allowMissingReturnTag" value="true" />
</module>
<!-- 检查是否存在TODO(待处理) TODO是javaIDE自动生成的。一般代码写完后要去掉 -->
<module name="TodoComment"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck">
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF"/>
<property name="tagOrder"
value="@param, @author, @since, @see, @version, @serial, @deprecated"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck">
<property name="target" value="METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="tagOrder"
value="@param, @return, @throws, @since, @deprecated, @see"/>
</module>
<!-- Miscellaneous -->
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck">
<property name="tokens" value="BLOCK_COMMENT_BEGIN"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck"/>
<!-- Modifiers -->
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck"/>
<!-- 常量名的检查(只允许大写),默认^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ -->
<module name="ConstantName"/>
<!-- Regexp -->
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="format" value="^\t* +\t*\S"/>
<property name="message"
value="Line has leading space characters; indentation should be performed with tabs only."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<!-- \s匹配空白字符,$s匹配行尾。-->
<property name="format" value="\s+$"/>
<property name="message" value="禁止行尾有空格"/>
</module>
<!-- Class或Interface名检查,默认^[A-Z][a-zA-Z0-9]*$-->
<module name="TypeName">
<!-- module 的 Properties 可以控制如何去执行这个 module ,每个 property 都有一个默认值,所有的 check 都有一个 severity 属性,用它来指定 check 的 level -->
<!-- <property name="severity" value="warning"/>-->
<message key="name.invalidPattern" value="名称 ''{0}'' 要符合 ''{1}''格式."/>
</module>
<!--<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)" />
<property name="message"
value="Please use BDDMockito imports." />
<property name="ignoreComments" value="true" />
</module>-->
<!--
<module name="VisibilityModifier"/>
-->
<!-- 仅仅是static型的变量(不包括static final型)的检查 ^[a-z][a-zA-Z0-9_]*$ -->
<module name="StaticVariableName" >
<property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/>
</module>
<!--检查空块但不验证顺序块-->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<!-- 包名的检查(只允许小写字母),默认^[a-z]+(\.[a-zA-Z_][a-zA-Z_0-9_]*)*$ -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="包名 ''{0}'' 要符合 ''{1}''格式."/>
</module>
<!-- 局部的非final型的变量,包括catch中的参数的检查,^[a-z](_?[a-zA-Z0-9]+)*$ -->
<module name="LocalVariableName" >
<property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<!-- 局部的final变量,包括catch中的参数的检查 ^[A-Z][A-Z0-9]*$-->
<module name="LocalFinalVariableName" >
<property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<!--
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format"
value="org\.junit\.(Assert|jupiter\.api\.Assertions)\.assert"/>
<property name="message"
value="Please use AssertJ imports."/>
<property name="ignoreComments" value="true"/>
</module>
-->
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="format" value="printStackTrace"/>
<property name="message" value="禁止直接打印堆栈信息,请改用日志API"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="format" value="System\.out\.println"/>
<property name="message" value="禁止控制台打印,请改用日志API"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck">
<property name="format" value="[ \t]+$"/>
<property name="illegalPattern" value="true"/>
<property name="message" value="Trailing whitespace"/>
</module>
<!-- Whitespace -->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck">
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens"
value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS, ARRAY_DECLARATOR"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<!-- 方法不超过200行 -->
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="200"/>
</module>
<!--检查空行分隔符-->
<module name="EmptyLineSeparator">
<!--字段之间不允许空行-->
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<!--允许多个空行-->
<property name="allowMultipleEmptyLines" value="false"/>
<!--允许类成员内有多个空行-->
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
</module>
<!-- Iterator -->
<module name="EmptyForIteratorPad"/>
<!-- 操作符换行策略检查 -->
<module name="OperatorWrap"/>
<!-- 检查在某个特定关键字之前应保留空格 -->
<module name="NoWhitespaceBefore"/>
<!-- 代码质量 -->
<!-- 圈复杂度 -->
<module name="CyclomaticComplexity">
<property name="max" value="40"/>
</module>
</module>
</module>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。