alibaba / alibaba/Alibaba-Java-Coding-Guidelines

IDEA插件对变量命名的检测不算太完善

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.1k
Forks
246
PR merge metrics
No merged PRs in 30d

Description

在**阿里巴巴Java开发手册(终极版)**中的 **第六个模块 工程结构** 的 **第一部分 应用分层** 的3中描述了分层领域模型规约。里面有写到xxxAO表示的应用对象。 这是前提1

我们知道在IDEA插件中中对命名一般是需要遵循首字母大写的,但是对于VO,DTO之类结尾的POJO类对象可以命名为xxxVO,xxxDTO不必严格遵守首字母大写的规约。这是前提2

IDEA的编码插件检测变量时会检测出不符合驼峰命名的变量。这是前提3

我的问题是,在IDEA中的编码插件对变量的命名检测不够完善。如:
```java
class NameAO { //类的命名符合规约
private NameAO nameAO; // 但是这个变量的命名符合规约但是插件会给出 **不符合驼峰命名的warning**
}
class NameVO { // 类的命名符合规约
private NameVO nameVO; //这个变量的命名符合规约,插件没有给出warning
```
综上,我认为这是不合理的,插件在对nameAO的命名中不应该给出警告。

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the IDEA naming inspection with the NameAO/nameAO and NameVO/nameVO examples described in the issue, and compare the warnings. The work is done when the inspection accepts the AO variable naming consistently with the stated naming convention and the existing VO/DTO behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.