Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于注解内常量的检查 #34

Closed
shaonialife opened this issue Oct 16, 2017 · 9 comments
Closed

关于注解内常量的检查 #34

shaonialife opened this issue Oct 16, 2017 · 9 comments

Comments

@shaonialife
Copy link

shaonialife commented Oct 16, 2017

@interface 中写的 常量,本身默认含有 public static final 修饰,命名按照常量规范命名,但是规约插件检测为变量,提示 不符合 lowerCamelCase 命名规范

@chenxuyuan2016
Copy link

chenxuyuan2016 commented Oct 16, 2017

是的,我也发现这个问题了。
不知道能不能修改规则,让interface 和 @interface的常量符合规范

@xuantan
Copy link
Collaborator

xuantan commented Oct 20, 2017

@shaonialife 提供个具体代码事例,最好是截图

@shaonialife
Copy link
Author

image

Sorry , 刚测试发现 interface 内的常量可以,@interface 内的不行,怪我看走眼了

@shaonialife shaonialife changed the title 关于接口内常量的检查 关于注解内常量的检查 Oct 20, 2017
@SeanCai
Copy link
Contributor

SeanCai commented Oct 31, 2017

注解里面定义的变量不是public static final的,所以请使用小写驼峰形式

@SeanCai SeanCai closed this as completed Oct 31, 2017
@shaonialife
Copy link
Author

从我上面发的图片可以看到 @IntDef 里面引用了 UploadStatus 里面的值,而 @IntDef 括号里面只能填写常量,间接就说明了在注解 UploadStatus 里面定义的那三个值就是常量

@SeanCai
Copy link
Contributor

SeanCai commented Nov 1, 2017

这个是 public final 不是public static final @shaonialife

@shaonialife
Copy link
Author

一图胜万言
image

@xuantan xuantan reopened this Mar 8, 2018
@xuantan
Copy link
Collaborator

xuantan commented Mar 8, 2018

@shaonialife 好的,确实是我们的问题,下一个版本中会修复掉。

@xuantan
Copy link
Collaborator

xuantan commented Nov 20, 2018

已发布,问题已修复。

@xuantan xuantan closed this as completed Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants