Make this line start at column 9 sonar violation fix(Source code should be indented consistently)(使这一行开始于第 9 列声纳违规修复(源代码应一致缩进))
问题描述
我正在修复所有声纳违规问题,我有将近 6k 的问题,例如 Make this line start at column 9"
问题.我尝试添加 java 格式化程序,但它并没有解决问题将我的声纳违规增加到 9k.请告诉我要使用哪种 java 格式化程序,以便它会投诉.
I am fixing all the sonar violation fix and I have nearly 6k issue like Make this line start at column 9"
issues. I tried adding the java formatter, but it did not resolve the issue instead increase my sonar violation to 9k. Can you please let me know which java formatter to use so it will complaint.
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>0.5.2</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
or
<!--Plugin for formatting the code base -->
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
这两种格式我都试过了,都没有解决问题,反而增加了问题.这个规则说源代码应该一致地缩进.格式化程序正在处理这个已经不确定为什么会发生这种违规行为.规则说缩进应该是一致的,而且是一致的.
I have tried both of these formaters, both did not resolve the issue instead increased the issue. The rule for this says Source code should be indented consistently. The formatter is taking care of this already not sure why this violation is happening. The rules says the indent should be consistent and it is consistent.
推荐答案
所以这有点老了,但我想我会继续回答未来.列是
So this is a little old but I thought I would go ahead and answer for the future. the columns are
12345
为此,我相信将缩进设置为 2 并重新格式化应该可以解决所有问题.
For this I believe setting your indentation to 2 and reformatting should fix everything.
这篇关于使这一行开始于第 9 列声纳违规修复(源代码应一致缩进)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使这一行开始于第 9 列声纳违规修复(源代码应一致缩进)
基础教程推荐
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01