在我们的代码中,我们有时会这样
public class Demo{
public String value(){
if (something){
while(true){
...
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我目前正在尝试配置我的checkstyle配置以强制开发人员在'{'之前有空格:
public class Demo {
public String value() {
if (something) {
while(true) {
...
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我无法让它发挥作用.有没有人知道这个特定设置的正确checkstyle配置?我想检查此代码作为我的gradle构建的一部分
如果您使用 eclipse,您可以查看“Window/Preferences/Java/Code Style/Formatter”。您几乎可以设置所有内容。
对于您的问题:

如果你想使用 checkstyle,你可以转到“Window/Preferences/Checkstyle/New ...”。并做类似的事情:

| 归档时间: |
|
| 查看次数: |
141 次 |
| 最近记录: |