p3c代码格式化配置

p3c 代码格式化配置

1.下载阿里代码格式化模板(templates 文件和 style文件)

git地址:https://github.com/alibaba/p3c/tree/master/p3c-formatter

2.导入templates文件

在windows-->preferences-->java-->code style--> code Templates 导入templates文件

 

3.导入codeStyle文件

windows-->preferences-->java-->code style-->Formatter 导入 codeStyle文件

 

4.配置代码保存后自动格式化.(不强制)

在windows--->preferences--->java-->editor-->save action --> 勾选代码格式如图.

扫描二维码关注公众号,回复: 10412505 查看本文章

 

5.如上配置后,代码格式化后将是阿里的p3c 要求,并且tab 也将是4个空格代替.

猜你喜欢

转载自www.cnblogs.com/huakaiyoushi/p/12621272.html