Error Prone is never detected in Maven builds: the regex in jvm/analysis.py contains literal backspace bytes where \b was meant

Đang mở Phù hợp với người mới
#251 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, python
Lĩnh vực
tooling

Hướng nghiên cứu

Mẫu lỗi nằm ở dòng 183 của project_validator/ecosystems/jvm/analysis.py, trong regex _ERROR_PRONE, nơi các byte 0x08 thực tế thay thế cho \b. Chạy grep -P '\x08' -r project_validator để xác nhận đây là tệp duy nhất bị ảnh hưởng, rồi kiểm tra regex với các đoạn pom.xml được trích trong issue. Hoàn thành khi error_prone_core và -Xplugin:ErrorProne khớp, và kiểm tra phân tích tĩnh guava báo Error Prone đã được phát hiện.

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

Mô tả

project_validator/ecosystems/jvm/analysis.py:183 holds \x08 characters (a Python string "\b…" written without the raw prefix) where word boundaries were intended, so error_prone_core and -Xplugin:ErrorProne can never match: guava's static-analysis FAILs "no static analyzer runs" despite pom.xml:220 (and --answers shows Error Prone "defined": {}).

Evidence from the corpus audit

google/guava / static-analysis (Error Prone never detected in Maven builds)
  • kind: FALSE_NEGATIVE
  • actual: FAIL: JVM: no static analyzer runs (--answers: Error Prone "defined": {})
  • expected: PASS/WARN naming Error Prone: it is on the compiler's processor path and -Xplugin:ErrorProne is passed on every compile that mvn verify runs (guava only enables one check, Java8ApiChecker, which deserves a mention, not a miss)
  • evidence:
    • guava pom.xml:220: <arg>-Xplugin:ErrorProne -Xep:Java8ApiChecker:ERROR -XepDisableAllWarnings</arg>; pom.xml:238-240: <groupId>com.google.errorprone</groupId> / <artifactId>error_prone_core</artifactId>
    • validator project_validator/ecosystems/jvm/analysis.py:183 contains literal 0x08 bytes: sed -n 183p ... | cat -A →
      _ERROR_PRONE = re.compile(rf"^Herror_prone_core^H|-Xplugin:ErrorProne^H|{_ERROR_PRONE_GRADLE}");
      _ERROR_PRONE.pattern = '\x08error_prone_core\x08|-Xplugin:ErrorProne\x08|...';
      _ERROR_PRONE.search("<artifactId>error_prone_core</artifactId>") → False, _ERROR_PRONE.search("<arg>-Xplugin:ErrorProne -Xep</arg>") → False.
      Only the third alternative (Gradle id("net.ltgt.errorprone")) can match, which is why mockito and junit5 pass.
      grep -rlP '\x08' --include=*.py project_validator finds only this file.
  • repro: pom.xml whose maven-compiler-plugin has <annotationProcessorPaths><path><artifactId>error_prone_core</artifactId>... and <arg>-Xplugin:ErrorProne</arg>, workflow run: mvn verify
  • confidence: high

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
10 giờ 41 phút
Pull request đã merge (30 ngày)
79

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

Issue tương tự

Thêm issue về Python

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.