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 列声纳违规修复(源代码应一致缩进)
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01