Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Error activating / deactivating rules with the same name

未关闭
#170 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
tooling

调研方向

从 Eclipse's PMD Rule Configuration 开始,检查存储已激活规则的 Eclipse 首选项文件。重现 Java/Ecmascript 同名规则的情况,然后验证在应用设置并重新构建后,特定于语言的激活和停用仍然会持久化,且不会报告已停用规则的违规问题。

由索引模型根据 Issue 内容生成。

描述

bug

Hi, I think I spotted a bug when I try to activate a rule in Java and deactivate the rule with the same name in all other languages.

Tested with Eclipse 4.25.0 (2022-09) and PMD plugin 4.40.0.v20221029

Steps to reproduce:

  • Install PMD Eclipse plugin
  • Import project with Java and Javascript. In my case, the Java is the code I actually want to check, and the Javascript is automatically generated in target directory (Jacoco report in HTML/JS format), I don't want to see violations for
  • Go to Window -> Preferences -> PMD Rule Configuration
  • Activate rules manually: choose to activate AssignmentInOperand for Java and deactivate it for Ecmascript
  • Apply & close, click Yes when it asks for a full rebuild
  • The project sees violations in the Javascript that we just deactivated :'(
  • Reopen Window -> Preferences -> PMD Rule Configuration
  • The Ecmascript rule we just deactivated is now activate again :'(

I played around with Eclipse preference files, it seems that the activated rules are stored just with their names without mentioning the language and without storing the rules properties. This would break when several rules have the same name.

I worked around this bug by ignoring the target folder in the File Filters preference.

主要语言
Java
星标
99
派生
42
平均合并
1 天 2 小时
30 天内合并 PR
10

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pmd/pmd-eclipse-plugin 的其他 Issue

查看 pmd/pmd-eclipse-plugin 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。