让这一行开始于第9列声纳违规修复(源代码应该一致缩进) [英] Make this line start at column 9 sonar violation fix(Source code should be indented consistently)

查看:868
本文介绍了让这一行开始于第9列声纳违规修复(源代码应该一致缩进)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修复所有的声纳违规修复,我有近6k的问题,比如让这行开始于第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列声纳违规修复(源代码应该一致缩进)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆