[3.4.0-map-sdk] code style and add npl catch

This commit is contained in:
zhongchao
2023-09-21 16:35:23 +08:00
parent 6340f0f8bd
commit 59c27070ce
17 changed files with 66 additions and 44 deletions

View File

@@ -13,6 +13,8 @@
<exclude-pattern>.*/gen/.*</exclude-pattern>
<exclude-pattern>.*Dagger*.*</exclude-pattern>
<!-- 最佳实践 -->
<!-- 用log代替e.PrintStackTrace -->
<!-- <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace" />-->
<!-- for/foreach 避免index重新赋值 -->
@@ -33,6 +35,18 @@
<property name="strictMode" value="true" />
</properties>
</rule>
<!-- 检查赋值字段未使用问题 -->
<rule ref="category/java/bestpractices.xml/UnusedAssignment">
<properties>
<property name="checkUnusedPrefixIncrement" value="true" />
<property name="reportUnusedVariables" value="true" />
</properties>
</rule>
<!-- 检查未使用的局部变量 -->
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
<!-- 检查未使用的private变量 -->
<!-- <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />-->
<rule ref="category/java/bestpractices.xml/UseStandardCharsets" />
<!-- 容易出现运行时错误 -->
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />