阿里java代码规范IDEA添加插件

转自: https://blog.csdn.net/sinat_42338962/article/details/84842571

 

为了尽量自己写好代码,为了尽量团队代码风格统一,有一套可执行的规范是再好不过了,《阿里巴巴Java开发手册》对JAVA编码规范做了一个总结,并且把这个规范做成了一个很好用的IDEA插件,可以让我们的代码看上去更加舒适。

1.打开IDEA,点击File->Settings->Plugins
2.查找alibaba插件并安装,然后重启IDEA


3.使用 : 右键项目->编码规约扫描


检查结果就有啦


另外还可以参考文件代码模板预设的变量自定义注释模板
${PACKAGE_NAME} - the name of the target package where the new class or interface will be created.
(将创建新类或接口的目标包的名称)
${PROJECT_NAME} - the name of the current project.
(当前项目的名称)
${FILE_NAME} - the name of the PHP file that will be created.
(将创建PHP文件的名称。)
${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.
(在文件创建过程中在新文件对话框中指定的新文件的名称。)
${USER} - the login name of the current user.
(当前用户的登录名。)
${DATE} - the current system date.
(当前系统日期。)
${TIME} - the current system time.
(当前系统时间。)
${YEAR} - the current year.
(当前的年。)
${MONTH} - the current month.
(当前的月。)
${DAY} - the current day of the month.
(本月的今天。)
${HOUR} - the current hour.
(当前的小时。)
${MINUTE} - the current minute.
(当前的分钟)
${PRODUCT_NAME} - the name of the IDE in which the file will be created.
(将在其中创建文件的IDEA的名称。)
${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.
(月份名称的前3个字母。例如:简、二月等。)
${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.
(一个月的全名。例如:一月、二月等。)

 

--------------------- 
作者:全世界最好的肥猪精 
来源:CSDN 
原文:https://blog.csdn.net/sinat_42338962/article/details/84842571 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值