p3c 能出一个idea的代码格式化的codestyle文件么

ss2ws0br  于 2个月前  发布在  其他
关注(0)|答案(5)|浏览(44)

目前只有eclipse的代码格式化文件,导入到idea里有很多问题。希望能象谷歌一样再出一个针对idea的格式化文件

r6vfmomb

r6vfmomb1#

虽然我不用eclipse不过我觉得代码格式约束是针对代码本身的,不应该与编辑器挂钩,而应该集成在maven

给你个例子:

https://github.com/apache/commons-lang/tree/master/src/site/resources/checkstyle

相关pom:

https://github.com/apache/commons-lang/blob/master/pom.xml

carvr3hs

carvr3hs2#

虽然我不用eclipse不过我觉得代码格式约束是针对代码本身的,不应该与编辑器挂钩,而应该集成在maven

给你个例子:

https://github.com/apache/commons-lang/tree/master/src/site/resources/checkstyle

相关pom:

https://github.com/apache/commons-lang/blob/master/pom.xml

有点不太明白,在maven里添加了插件后,我格式化代码的时候可以按照指定格式来吗

yshpjwxd

yshpjwxd3#

在idea下需要先安装Eclipse Code Formatter插件,然后点击File-->Settings-->Other Settings-->Eclipse Code Formatter,选择Use the Eclipse Code Formatter,在Eclipse Java Formatter config file中选择eclipse的代码格式化模板,点击OK完成设置即可。
格式化之后效果与Eclipse下格式化出来的是一样的。

bq3bfh9z

bq3bfh9z5#

为什么我用了这么多次都是解析错误啊,我同事也这样

相关问题