Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[BUG][code-analyzer] Potential PMD Issue: exclude-pattern in Referenced Ruleset Not Respected

Đang mở
#1,820 9 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện quá trình quét với custom-ruleset.xml được cung cấp và công cụ PMD, kiểm tra xem ba mục exclude-pattern có được áp dụng khi các quy tắc được tham chiếu hay không. Được xem là hoàn tất khi các tệp có tiền tố fflib_ và TM không được xử lý, trong khi các quy tắc Apex được liệt kê vẫn chạy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

WaitingForFixFromPMD

I'm encountering an issue with configuring code-analyzer to exclude files with specific prefixes. This is for a Salesforce org repository, and I'm using the PMD engine with a custom custom-ruleset.xml file. Despite specifying the prefixes to be ignored, the scanner still seems to process those files. For example I want to exclude Apex classes that have a prefix of fflib_ or TM. This is what the custom-ruleset.xml file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Custom Apex Rules"
         xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
                             https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

  <description>
    PMD ruleset that excludes fflib-related and TM-prefixed classes and their metadata files.
  </description>

  <!-- Exclude patterns -->
  <exclude-pattern>.*/fflib_.*\.(cls|trigger|cls-meta\.xml|trigger-meta\.xml)$</exclude-pattern>
  <exclude-pattern>.*/fflib-.*/.*\.(cls|trigger|cls-meta\.xml|trigger-meta\.xml)$</exclude-pattern>
  <exclude-pattern>.*/TM[^/]*\.(cls|trigger|cls-meta\.xml|trigger-meta\.xml)$</exclude-pattern>

  <!-- Apex rules -->
  <rule ref="category/apex/design.xml/CognitiveComplexity"/>
  <rule ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveAsserts"/>
</ruleset>

Do you have any suggestions on what I might be missing? Thanks in advance for your help!

Ngôn ngữ chính
TypeScript
Star
241
Fork
51
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của forcedotcom/code-analyzer

Tất cả issue của forcedotcom/code-analyzer

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.