alibaba / alibaba/p3c

使用pmd-xml扩展xml文件规范扫描问题

Open
#765 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
30.8k
Forks
8k
PR merge metrics
No merged PRs in 30d

Description

在p3c-pmd中添加pmd-xml支持,以实现对Android资源文件的扫描,部分修改如下:
1、在`resources/rulesets/java`文件夹下添加`ali-xml.xml`规则
```

3

#999999
#b0000000
]]>


```
2、添加文案
```

#999999
#b0000000]]>

```
3、在idea-plugin的`AliLocalInspectionToolProvider`文件中也添加了xml文件的扫描
![image](https://user-images.githubusercontent.com/20200752/94361617-23533380-00e8-11eb-94d4-4121a262ac8b.png)

#### 求助(插件运行无报错)
1、在Preferences | Editor | Inspections中Rule找不到对应文案。
![image](https://user-images.githubusercontent.com/20200752/94361663-a5dbf300-00e8-11eb-8330-e803b03ef342.png)
2、在Android的colors.xml文件中对应规则也不生效

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with resources/rulesets/java/ali-xml.xml and the added message entry, then inspect AliLocalInspectionToolProvider to trace how XML inspections are registered. Reproduce the issue in Preferences | Editor | Inspections and with an Android colors.xml file; done means the rule is listed with its message and reports the described color names.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, xml
Domain
tooling
Issue type
Feature
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.