@boyingliu01/xp-gate 0.8.1 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/java.sh +1 -1
- package/adapters/plugins/book299-20132-python/README.md +21 -0
- package/adapters/plugins/book299-20132-python/plugin.yml +21 -0
- package/adapters/plugins/book299-20132-python/rules/exception/gen-0023.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/logging/gen-0071.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0001.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0002.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0003.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0004.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0005.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0006.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0007.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0008.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0009.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0010.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0011.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0012.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0013.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0014.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0015.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0016.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0017.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0018.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0019.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0020.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0021.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0022.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0024.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0025.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0026.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0027.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0028.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0029.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0030.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0031.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0032.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0033.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0034.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0035.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0036.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0037.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0038.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0039.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0040.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0041.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0042.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0043.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0044.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0045.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0046.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0047.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0048.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0049.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0050.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0051.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0052.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0053.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0054.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0055.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0056.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0057.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0058.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0059.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0060.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0061.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0062.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0063.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0064.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0065.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0066.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0067.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0068.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0069.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0070.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0072.yml +14 -0
- package/adapters/plugins/book299-20132-python/rules/style/gen-0073.yml +14 -0
- package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +4 -0
- package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +20 -0
- package/adapters/plugins/book299-4081-c/README.md +21 -0
- package/adapters/plugins/book299-4081-c/plugin.yml +21 -0
- package/adapters/plugins/book299-4081-c/rules/collection/c/345/273/272-5-12.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/collection/c/345/273/272-5-8.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/concurrency/c/350/247/204-4-19.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/concurrency/c/350/247/204-4-20.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-11.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-12.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-6.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-8.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-9.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-13.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-6.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-7.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/performance/c/350/247/204-4-14.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/performance/c/350/247/204-4-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/resource/c/345/273/272-4-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/security/c/350/247/204-4-13.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-5.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-6.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-7.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-8.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-4-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-4-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-10.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-11.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-5.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-9.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-10.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-11.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-12.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-13.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-14.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-16.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-17.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-18.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-19.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-20.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-5.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-6.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-7.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-8.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-9.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-10.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-11.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-12.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-13.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-14.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-15.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-16.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-17.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-18.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-19.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-2.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-20.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-21.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-22.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-5.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-6.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-7.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-8.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-9.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-1.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-10.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-15.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-16.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-17.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-18.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-3.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-4.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-5.yml +14 -0
- package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-7.yml +14 -0
- package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +4 -0
- package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +20 -0
- package/adapters/plugins/book299-4083-javascriptes5/README.md +21 -0
- package/adapters/plugins/book299-4083-javascriptes5/plugin.yml +21 -0
- package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0001.yml +14 -0
- package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0002.yml +14 -0
- package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0003.yml +14 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +4 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +20 -0
- package/adapters/plugins/p3c-java/README.md +66 -0
- package/adapters/plugins/p3c-java/plugin.yml +30 -0
- package/adapters/plugins/p3c-java/scripts/install-gradle-p3c.sh +45 -0
- package/adapters/plugins/p3c-java/scripts/install-maven-p3c.sh +98 -0
- package/adapters/plugins/p3c-java/templates/gradle/xp-gate-p3c-gradle.gradle +68 -0
- package/adapters/plugins/p3c-java/templates/maven/xp-gate-p3c-profile.xml +81 -0
- package/adapters/plugins/whalecloud-java/README.md +98 -0
- package/adapters/plugins/whalecloud-java/plugin.yml +45 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-008.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-009.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-010.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-011.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-012.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-008.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-009.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-010.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-011.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-012.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-013.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-014.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-008.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-009.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-010.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/exception/wc-except-011.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/logging/wc-log-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-008.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/security/wc-secu-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/security/wc-secu-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/security/wc-secu-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/security/wc-secu-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/security/wc-secu-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-001.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-002.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-003.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-004.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-005.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-006.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-007.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-008.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-009.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-010.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-011.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-012.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-013.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-014.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-015.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-016.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-017.yml +17 -0
- package/adapters/plugins/whalecloud-java/rules/style/wc-style-018.yml +17 -0
- package/adapters/plugins/whalecloud-java/scripts/install-gradle-whalecloud.sh +97 -0
- package/adapters/plugins/whalecloud-java/scripts/install-maven-whalecloud.sh +201 -0
- package/adapters/plugins/whalecloud-java/templates/gradle/xp-gate-whalecloud-gradle.gradle +73 -0
- package/adapters/plugins/whalecloud-java/templates/maven/xp-gate-whalecloud-profile.xml +148 -0
- package/bin/xp-gate.js +111 -129
- package/hooks/pre-commit +31 -27
- package/hooks/pre-push +7 -3
- package/lib/__tests__/baseline.test.js +123 -0
- package/lib/__tests__/migrate.test.js +20 -0
- package/lib/__tests__/ui-detector.test.ts +94 -0
- package/lib/__tests__/uninstall.test.js +36 -0
- package/lib/__tests__/update-skill.test.js +11 -0
- package/lib/baseline.js +392 -0
- package/lib/doctor.js +127 -141
- package/lib/gate-audit.ts +25 -8
- package/lib/init.js +57 -2
- package/lib/migrate.js +74 -73
- package/lib/ui-detector.ts +3 -3
- package/lib/uninstall.js +63 -31
- package/lib/update-skill.js +32 -34
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +41 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +178 -4
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/opencode/package.json +28 -4
- package/plugins/opencode/scripts/prepack.cjs +85 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/opencode/skills/ralph-loop/SKILL.md +41 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/opencode/skills/sprint-flow/SKILL.md +178 -4
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/qoder/skills/ralph-loop/SKILL.md +41 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/qoder/skills/sprint-flow/SKILL.md +147 -4
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
- package/skills/delphi-review/AGENTS.md +1 -1
- package/skills/ralph-loop/SKILL.md +41 -3
- package/skills/sprint-flow/AGENTS.md +1 -1
- package/skills/sprint-flow/SKILL.md +178 -4
- package/skills/test-specification-alignment/AGENTS.md +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Auto-generated Maven install script
|
|
3
|
+
set -e
|
|
4
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
5
|
+
PROJECT_ROOT="${1:-.}"
|
|
6
|
+
cd "$PROJECT_ROOT"
|
|
7
|
+
if [ ! -f "pom.xml" ]; then
|
|
8
|
+
echo "❌ No pom.xml found"
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
if grep -q "<id>xp-gate-$(basename "$PLUGIN_DIR")</id>" pom.xml; then
|
|
12
|
+
echo "✅ Already installed"
|
|
13
|
+
exit 0
|
|
14
|
+
fi
|
|
15
|
+
cat >> pom.xml << 'APPEND'
|
|
16
|
+
<!-- Auto-generated XP-Gate plugin profile -->
|
|
17
|
+
<!-- See plugin documentation for details -->
|
|
18
|
+
<profiles><profile><id>xp-gate-AUTO</id></profile></profiles>
|
|
19
|
+
APPEND
|
|
20
|
+
echo "✅ Plugin profile installed"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# book299-4083-javascriptes5
|
|
2
|
+
|
|
3
|
+
Auto-generated plugin from spec document.
|
|
4
|
+
|
|
5
|
+
## Source
|
|
6
|
+
- **Spec file**: book299-4083-JavaScript(ES5)语言编码规范.txt
|
|
7
|
+
- **Language**: js
|
|
8
|
+
- **Generated**: 2026-05-13
|
|
9
|
+
- **Rule count**: 3
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### Maven
|
|
14
|
+
```bash
|
|
15
|
+
bash githooks/adapters/plugins/scripts/install-maven.sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Gradle
|
|
19
|
+
```bash
|
|
20
|
+
bash githooks/adapters/plugins/scripts/install-gradle.sh
|
|
21
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: book299-4083-javascriptes5
|
|
3
|
+
name: book299-4083-javascriptes5
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
languages: [js]
|
|
6
|
+
description: |
|
|
7
|
+
Auto-generated plugin from spec document: book299-4083-JavaScript(ES5)语言编码规范.txt
|
|
8
|
+
Generated by xp-gate init on 2026-05-13.
|
|
9
|
+
source_file: book299-4083-JavaScript(ES5)语言编码规范.txt
|
|
10
|
+
severity: error
|
|
11
|
+
categories:
|
|
12
|
+
- wc-style: Coding style rules
|
|
13
|
+
- wc-security: Security rules
|
|
14
|
+
- wc-performance: Performance rules
|
|
15
|
+
maven:
|
|
16
|
+
profile: xp-gate-book299-4083-javascriptes5
|
|
17
|
+
profile_file: templates/maven/xp-gate-book299-4083-javascriptes5-profile.xml
|
|
18
|
+
install_script: scripts/install-maven.sh
|
|
19
|
+
gradle:
|
|
20
|
+
config_file: templates/gradle/xp-gate-book299-4083-javascriptes5.gradle
|
|
21
|
+
install_script: scripts/install-gradle.sh
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GEN-0001
|
|
3
|
+
name: 对于包含重要信息(如app-signature 数字签名信息等)的前端js文件需要进行混淆加固(规范来源: 安全治理单11109465)
|
|
4
|
+
severity: error
|
|
5
|
+
tool: auto
|
|
6
|
+
category: wc-security
|
|
7
|
+
description: |
|
|
8
|
+
对于包含重要信息(如app-signature 数字签名信息等)的前端js文件需要进行混淆加固(规范来源: 安全治理单11109465)
|
|
9
|
+
|
|
10
|
+
Auto-extracted from book299-4083-JavaScript(ES5)语言编码规范.txt.
|
|
11
|
+
|
|
12
|
+
check:
|
|
13
|
+
type: ast-grep
|
|
14
|
+
pattern: TODO
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GEN-0002
|
|
3
|
+
name: 前端应用,主要涉及到nginx的基础镜像,需要使用国际业务运营中心-平台技术部提供的基础安全镜像(规范来源: 严重生产故障3791904)
|
|
4
|
+
severity: error
|
|
5
|
+
tool: auto
|
|
6
|
+
category: wc-security
|
|
7
|
+
description: |
|
|
8
|
+
前端应用,主要涉及到nginx的基础镜像,需要使用国际业务运营中心-平台技术部提供的基础安全镜像(规范来源: 严重生产故障3791904)
|
|
9
|
+
|
|
10
|
+
Auto-extracted from book299-4083-JavaScript(ES5)语言编码规范.txt.
|
|
11
|
+
|
|
12
|
+
check:
|
|
13
|
+
type: ast-grep
|
|
14
|
+
pattern: TODO
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GEN-0003
|
|
3
|
+
name: 禁止在前端 js、css、html 文件中包含物理路径信息、数据库连接信息、SQL语句信息、appKey/accessSecret、对象存储 key/secre
|
|
4
|
+
severity: error
|
|
5
|
+
tool: auto
|
|
6
|
+
category: wc-security
|
|
7
|
+
description: |
|
|
8
|
+
禁止在前端 js、css、html 文件中包含物理路径信息、数据库连接信息、SQL语句信息、appKey/accessSecret、对象存储 key/secre
|
|
9
|
+
|
|
10
|
+
Auto-extracted from book299-4083-JavaScript(ES5)语言编码规范.txt.
|
|
11
|
+
|
|
12
|
+
check:
|
|
13
|
+
type: ast-grep
|
|
14
|
+
pattern: TODO
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Auto-generated Maven install script
|
|
3
|
+
set -e
|
|
4
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
5
|
+
PROJECT_ROOT="${1:-.}"
|
|
6
|
+
cd "$PROJECT_ROOT"
|
|
7
|
+
if [ ! -f "pom.xml" ]; then
|
|
8
|
+
echo "❌ No pom.xml found"
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
if grep -q "<id>xp-gate-$(basename "$PLUGIN_DIR")</id>" pom.xml; then
|
|
12
|
+
echo "✅ Already installed"
|
|
13
|
+
exit 0
|
|
14
|
+
fi
|
|
15
|
+
cat >> pom.xml << 'APPEND'
|
|
16
|
+
<!-- Auto-generated XP-Gate plugin profile -->
|
|
17
|
+
<!-- See plugin documentation for details -->
|
|
18
|
+
<profiles><profile><id>xp-gate-AUTO</id></profile></profiles>
|
|
19
|
+
APPEND
|
|
20
|
+
echo "✅ Plugin profile installed"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# p3c-pmd — Alibaba Java Coding Guidelines Plugin
|
|
2
|
+
|
|
3
|
+
阿里 Java 开发规范检查插件,基于 [alibaba/p3c](https://github.com/alibaba/p3c) PMD 实现。
|
|
4
|
+
|
|
5
|
+
## 覆盖规则
|
|
6
|
+
|
|
7
|
+
54 条规则,10 个类别:
|
|
8
|
+
|
|
9
|
+
| 类别 | 规则数 | 内容 |
|
|
10
|
+
|------|--------|------|
|
|
11
|
+
| ali-comment | 6 | Javadoc 和注释规约 |
|
|
12
|
+
| ali-concurrent | 8 | 并发编程规约 |
|
|
13
|
+
| ali-constant | 3 | 常量定义规约 |
|
|
14
|
+
| ali-exception | 4 | 异常处理规约 |
|
|
15
|
+
| ali-flowcontrol | 6 | 控制语句规约 |
|
|
16
|
+
| ali-naming | 9 | 命名规约 |
|
|
17
|
+
| ali-oop | 7 | OOP 规约 |
|
|
18
|
+
| ali-orm | 5 | ORM/SQL 规约 |
|
|
19
|
+
| ali-other | 3 | 其他规约 |
|
|
20
|
+
| ali-set | 3 | 集合处理规约 |
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
### Maven 项目
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bash githooks/adapters/plugins/p3c-java/scripts/install-maven-p3c.sh
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
安装后会自动将 `xp-gate-p3c` profile 注入 pom.xml。
|
|
31
|
+
|
|
32
|
+
### Gradle 项目
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bash githooks/adapters/plugins/p3c-java/scripts/install-gradle-p3c.sh
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 手动运行
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Maven
|
|
42
|
+
mvn clean verify -P xp-gate-p3c
|
|
43
|
+
|
|
44
|
+
# Gradle
|
|
45
|
+
./gradlew xp-gateP3cCheck
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 插件结构
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
p3c-java/
|
|
52
|
+
├── plugin.yml # 插件元数据
|
|
53
|
+
├── README.md # 说明文档
|
|
54
|
+
├── templates/
|
|
55
|
+
│ ├── maven/xp-gate-p3c-profile.xml # Maven profile 模板
|
|
56
|
+
│ └── gradle/xp-gate-p3c-gradle.gradle # Gradle 配置模板
|
|
57
|
+
└── scripts/
|
|
58
|
+
├── install-maven-p3c.sh # Maven 安装脚本
|
|
59
|
+
└── install-gradle-p3c.sh # Gradle 安装脚本
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 与浩鲸规范的关系
|
|
63
|
+
|
|
64
|
+
浩鲸 Java 规范以阿里规范为基础,但增加了企业内部积累的经验规则。
|
|
65
|
+
本插件提供阿里规范作为**默认基线**。浩鲸个性化规范后续会在 `whalecloud-java` 插件中
|
|
66
|
+
作为增强层叠加。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: p3c-java
|
|
3
|
+
name: Alibaba Java Coding Guidelines (p3c-pmd)
|
|
4
|
+
version: 2.1.1
|
|
5
|
+
languages: [java]
|
|
6
|
+
description: >
|
|
7
|
+
阿里巴巴 Java 开发手册规范检查,基于 p3c-pmd 实现。
|
|
8
|
+
覆盖 54 条规则,10 个检查类别,是浩鲸科技等国内企业 Java 规范的基线。
|
|
9
|
+
author: Alibaba Group (p3c project)
|
|
10
|
+
rules_count: 54
|
|
11
|
+
severity: error
|
|
12
|
+
categories:
|
|
13
|
+
- ali-comment: Javadoc 和注释规约 (6 条)
|
|
14
|
+
- ali-concurrent: 并发编程规约 (8 条)
|
|
15
|
+
- ali-constant: 常量定义规约 (3 条)
|
|
16
|
+
- ali-exception: 异常处理规约 (4 条)
|
|
17
|
+
- ali-flowcontrol: 控制语句规约 (6 条)
|
|
18
|
+
- ali-naming: 命名规约 (9 条)
|
|
19
|
+
- ali-oop: OOP 规约 (7 条)
|
|
20
|
+
- ali-orm: ORM/SQL 规约 (5 条)
|
|
21
|
+
- ali-other: 其他规约 (3 条)
|
|
22
|
+
- ali-set: 集合处理规约 (3 条)
|
|
23
|
+
maven:
|
|
24
|
+
profile: xp-gate-p3c
|
|
25
|
+
profile_file: templates/maven/xp-gate-p3c-profile.xml
|
|
26
|
+
install_script: scripts/install-maven-p3c.sh
|
|
27
|
+
gradle:
|
|
28
|
+
config_file: templates/gradle/xp-gate-p3c-gradle.gradle
|
|
29
|
+
install_script: scripts/install-gradle-p3c.sh
|
|
30
|
+
rules_path: https://github.com/alibaba/p3c/tree/master/p3c-pmd/src/main/resources/rulesets/java
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install p3c-pmd into a Gradle project for XP-Gate Java quality gate.
|
|
3
|
+
# Usage: bash scripts/install-gradle-p3c.sh [project_root]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
8
|
+
PROJECT_ROOT="${1:-.}"
|
|
9
|
+
|
|
10
|
+
cd "$PROJECT_ROOT"
|
|
11
|
+
|
|
12
|
+
if [ ! -f "build.gradle" ] && [ ! -f "build.gradle.kts" ]; then
|
|
13
|
+
echo "❌ No build.gradle found in $(pwd)"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
18
|
+
echo " XP-Gate: Installing p3c-pmd for Gradle projects"
|
|
19
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
GRADLE_FILE=""
|
|
23
|
+
if [ -f "build.gradle" ]; then
|
|
24
|
+
GRADLE_FILE="build.gradle"
|
|
25
|
+
elif [ -f "build.gradle.kts" ]; then
|
|
26
|
+
GRADLE_FILE="build.gradle.kts"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if grep -q 'XP-GateP3cCheck\|p3c-pmd' "$GRADLE_FILE" 2>/dev/null; then
|
|
30
|
+
echo "✅ p3c-pmd already configured in $GRADLE_FILE"
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
echo "ℹ️ Appending p3c-pmd configuration to $GRADLE_FILE..."
|
|
35
|
+
{
|
|
36
|
+
echo ""
|
|
37
|
+
echo "// XP-Gate: Alibaba p3c-pmd quality gate"
|
|
38
|
+
echo "apply from: '$PLUGIN_DIR/templates/gradle/xp-gate-p3c-gradle.gradle'"
|
|
39
|
+
echo ""
|
|
40
|
+
} >> "$GRADLE_FILE"
|
|
41
|
+
|
|
42
|
+
echo ""
|
|
43
|
+
echo "✅ p3c-pmd installed successfully!"
|
|
44
|
+
echo ""
|
|
45
|
+
echo " # Run: ./gradlew XP-GateP3cCheck"
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install p3c-pmd into a Maven project for XP-Gate Java quality gate.
|
|
3
|
+
# Usage: bash scripts/install-maven-p3c.sh [project_root]
|
|
4
|
+
#
|
|
5
|
+
# This script:
|
|
6
|
+
# 1. Detects if pom.xml exists
|
|
7
|
+
# 2. Merges xp-gate-p3c profile into pom.xml (or creates profile snippet)
|
|
8
|
+
# 3. Outputs instructions for running p3c check
|
|
9
|
+
|
|
10
|
+
set -e
|
|
11
|
+
|
|
12
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
13
|
+
PROJECT_ROOT="${1:-.}"
|
|
14
|
+
|
|
15
|
+
cd "$PROJECT_ROOT"
|
|
16
|
+
|
|
17
|
+
if [ ! -f "pom.xml" ]; then
|
|
18
|
+
echo "❌ No pom.xml found in $(pwd)"
|
|
19
|
+
echo "This script requires a Maven project."
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
24
|
+
echo " XP-Gate: Installing p3c-pmd for Java quality gate"
|
|
25
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
26
|
+
echo ""
|
|
27
|
+
|
|
28
|
+
PROFILE_FILE="$PLUGIN_DIR/templates/maven/xp-gate-p3c-profile.xml"
|
|
29
|
+
|
|
30
|
+
# Check if p3c profile already exists
|
|
31
|
+
if grep -q '<id>xp-gate-p3c</id>' pom.xml; then
|
|
32
|
+
echo "✅ p3c-pmd profile already exists in pom.xml"
|
|
33
|
+
echo ""
|
|
34
|
+
echo "To run: mvn clean verify -P xp-gate-p3c"
|
|
35
|
+
exit 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Check if pom.xml has a profiles section
|
|
39
|
+
if grep -q '<profiles>' pom.xml; then
|
|
40
|
+
# Insert profile before </profiles>
|
|
41
|
+
echo "ℹ️ Merging p3c-pmd profile into existing <profiles> section..."
|
|
42
|
+
|
|
43
|
+
# Create a temp file with the profile content
|
|
44
|
+
TEMP_PROFILE=$(mktemp)
|
|
45
|
+
cat "$PROFILE_FILE" > "$TEMP_PROFILE"
|
|
46
|
+
|
|
47
|
+
# Use sed to insert before </profiles>
|
|
48
|
+
# Find the line number of </profiles>
|
|
49
|
+
PROFILES_END_LINE=$(grep -n '</profiles>' pom.xml | head -1 | cut -d: -f1)
|
|
50
|
+
|
|
51
|
+
if [ -n "$PROFILES_END_LINE" ]; then
|
|
52
|
+
head -n $((PROFILES_END_LINE - 1)) pom.xml > pom.xml.tmp
|
|
53
|
+
{
|
|
54
|
+
echo ""
|
|
55
|
+
echo " <!-- XP-Gate: Alibaba p3c-pmd quality gate profile -->"
|
|
56
|
+
sed 's/^/ /' "$TEMP_PROFILE"
|
|
57
|
+
echo ""
|
|
58
|
+
} >> pom.xml.tmp
|
|
59
|
+
tail -n +"$PROFILES_END_LINE" pom.xml >> pom.xml.tmp
|
|
60
|
+
mv pom.xml.tmp pom.xml
|
|
61
|
+
fi
|
|
62
|
+
else
|
|
63
|
+
# No profiles section, append before </project>
|
|
64
|
+
echo "ℹ️ Appending p3c-pmd profile to pom.xml..."
|
|
65
|
+
|
|
66
|
+
PROJECT_END_LINE=$(grep -n '</project>' pom.xml | tail -1 | cut -d: -f1)
|
|
67
|
+
|
|
68
|
+
if [ -n "$PROJECT_END_LINE" ]; then
|
|
69
|
+
head -n $((PROJECT_END_LINE - 1)) pom.xml > pom.xml.tmp
|
|
70
|
+
{
|
|
71
|
+
echo ""
|
|
72
|
+
echo " <!-- XP-Gate: Alibaba p3c-pmd quality gate profile -->"
|
|
73
|
+
echo " <profiles>"
|
|
74
|
+
sed 's/^/ /' "$PROFILE_FILE"
|
|
75
|
+
echo ""
|
|
76
|
+
echo " </profiles>"
|
|
77
|
+
echo ""
|
|
78
|
+
} >> pom.xml.tmp
|
|
79
|
+
tail -n +"$PROJECT_END_LINE" pom.xml >> pom.xml.tmp
|
|
80
|
+
mv pom.xml.tmp pom.xml
|
|
81
|
+
fi
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
echo ""
|
|
85
|
+
echo "✅ p3c-pmd profile installed successfully!"
|
|
86
|
+
echo ""
|
|
87
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
88
|
+
echo " Usage"
|
|
89
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
90
|
+
echo ""
|
|
91
|
+
echo " # Run p3c-pmd checks:"
|
|
92
|
+
echo " mvn clean verify -P xp-gate-p3c"
|
|
93
|
+
echo ""
|
|
94
|
+
echo " # Run with fail on violation:"
|
|
95
|
+
echo " mvn clean verify -P xp-gate-p3c -Dpmd.failOnViolation=true"
|
|
96
|
+
echo ""
|
|
97
|
+
echo " # This will be integrated into XP-Gate pre-commit Gate 1"
|
|
98
|
+
echo ""
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// p3c-pmd Gradle configuration for XP-Gate Java quality gate.
|
|
3
|
+
// Provides Alibaba Java Coding Guidelines checks via PMD.
|
|
4
|
+
//
|
|
5
|
+
// Usage:
|
|
6
|
+
// ./gradlew pmdMain
|
|
7
|
+
// ./gradlew build -P p3cCheck
|
|
8
|
+
//
|
|
9
|
+
// Rules covered: 54 rules across 10 categories
|
|
10
|
+
// =============================================================================
|
|
11
|
+
|
|
12
|
+
plugins {
|
|
13
|
+
id 'pmd'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pmd {
|
|
17
|
+
// PMD 6.55.0+ includes p3c-pmd 2.1.1 compatibility
|
|
18
|
+
toolVersion = '6.55.0'
|
|
19
|
+
ruleSetFiles = files(
|
|
20
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-comment.xml",
|
|
21
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-concurrent.xml",
|
|
22
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-constant.xml",
|
|
23
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-exception.xml",
|
|
24
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-flowcontrol.xml",
|
|
25
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-naming.xml",
|
|
26
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-oop.xml",
|
|
27
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-orm.xml",
|
|
28
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-other.xml",
|
|
29
|
+
"https://raw.githubusercontent.com/alibaba/p3c/master/p3c-pmd/src/main/resources/rulesets/java/ali-set.xml"
|
|
30
|
+
)
|
|
31
|
+
ruleSets = [] // Clear default PMD rule sets, use only p3c rules
|
|
32
|
+
consoleOutput = true
|
|
33
|
+
ignoreFailures = project.hasProperty('p3cIgnoreFailures')
|
|
34
|
+
maxFailures = 0 // Block on any violation
|
|
35
|
+
reportsDir = file("$buildDir/reports/pmd")
|
|
36
|
+
|
|
37
|
+
// Optimize for CI/commit hook: only check changed files
|
|
38
|
+
incrementalAnalysis = true
|
|
39
|
+
incrementalAnalysisCacheFile = file("$buildDir/pmd/main.cache")
|
|
40
|
+
|
|
41
|
+
// Include test source directory
|
|
42
|
+
source = sourceSets.main.allJava + sourceSets.test.allJava
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Task alias for XP-Gate integration
|
|
46
|
+
task XP-GateP3cCheck(type: Pmd) {
|
|
47
|
+
description = 'Run p3c-pmd checks for XP-Gate quality gate'
|
|
48
|
+
group = 'verification'
|
|
49
|
+
ruleSetFiles = pmd.ruleSetFiles
|
|
50
|
+
ruleSets = []
|
|
51
|
+
consoleOutput = true
|
|
52
|
+
ignoreFailures = false
|
|
53
|
+
maxFailures = 0
|
|
54
|
+
source = sourceSets.main.allJava + sourceSets.test.allJava
|
|
55
|
+
reports {
|
|
56
|
+
html.required = true
|
|
57
|
+
xml.required = true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Make build depend on p3c check when P3C is enabled
|
|
62
|
+
project.afterEvaluate {
|
|
63
|
+
if (project.hasProperty('p3cCheck')) {
|
|
64
|
+
tasks.named('build').configure {
|
|
65
|
+
dependsOn tasks.named('XP-GateP3cCheck')
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
p3c-pmd Maven profile for XP-Gate Java quality gate.
|
|
4
|
+
Provides Alibaba Java Coding Guidelines checks via PMD.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
mvn clean compile pmd:check -P XP-Gate-p3c
|
|
8
|
+
mvn clean compile pmd:check -P XP-Gate-p3c -Dpmd.failOnViolation=true
|
|
9
|
+
|
|
10
|
+
Rules covered: 54 rules across 10 categories
|
|
11
|
+
- ali-comment, ali-concurrent, ali-constant, ali-exception,
|
|
12
|
+
ali-flowcontrol, ali-naming, ali-oop, ali-orm, ali-other, ali-set
|
|
13
|
+
-->
|
|
14
|
+
<profile>
|
|
15
|
+
<id>XP-Gate-p3c</id>
|
|
16
|
+
<activation>
|
|
17
|
+
<file>
|
|
18
|
+
<exists>${project.basedir}/src/main</exists>
|
|
19
|
+
</file>
|
|
20
|
+
</activation>
|
|
21
|
+
<build>
|
|
22
|
+
<plugins>
|
|
23
|
+
<plugin>
|
|
24
|
+
<groupId>org.apache.maven.plugins</groupId>
|
|
25
|
+
<artifactId>maven-pmd-plugin</artifactId>
|
|
26
|
+
<version>3.21.2</version>
|
|
27
|
+
<configuration>
|
|
28
|
+
<targetJdk>${java.version}</targetJdk>
|
|
29
|
+
<rulesets>
|
|
30
|
+
<ruleset>/rulesets/java/ali-comment.xml</ruleset>
|
|
31
|
+
<ruleset>/rulesets/java/ali-concurrent.xml</ruleset>
|
|
32
|
+
<ruleset>/rulesets/java/ali-constant.xml</ruleset>
|
|
33
|
+
<ruleset>/rulesets/java/ali-exception.xml</ruleset>
|
|
34
|
+
<ruleset>/rulesets/java/ali-flowcontrol.xml</ruleset>
|
|
35
|
+
<ruleset>/rulesets/java/ali-naming.xml</ruleset>
|
|
36
|
+
<ruleset>/rulesets/java/ali-oop.xml</ruleset>
|
|
37
|
+
<ruleset>/rulesets/java/ali-orm.xml</ruleset>
|
|
38
|
+
<ruleset>/rulesets/java/ali-other.xml</ruleset>
|
|
39
|
+
<ruleset>/rulesets/java/ali-set.xml</ruleset>
|
|
40
|
+
</rulesets>
|
|
41
|
+
<printFailingErrors>true</printFailingErrors>
|
|
42
|
+
<failOnViolation>true</failOnViolation>
|
|
43
|
+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
|
44
|
+
<outputEncoding>UTF-8</outputEncoding>
|
|
45
|
+
<analysisCache>true</analysisCache>
|
|
46
|
+
<maxWarnings>0</maxWarnings>
|
|
47
|
+
</configuration>
|
|
48
|
+
<executions>
|
|
49
|
+
<execution>
|
|
50
|
+
<id>p3c-check</id>
|
|
51
|
+
<phase>verify</phase>
|
|
52
|
+
<goals>
|
|
53
|
+
<goal>check</goal>
|
|
54
|
+
</goals>
|
|
55
|
+
<configuration>
|
|
56
|
+
<failOnViolation>${pmd.failOnViolation}</failOnViolation>
|
|
57
|
+
</configuration>
|
|
58
|
+
</execution>
|
|
59
|
+
<execution>
|
|
60
|
+
<id>p3c-cpd</id>
|
|
61
|
+
<phase>verify</phase>
|
|
62
|
+
<goals>
|
|
63
|
+
<goal>cpd-check</goal>
|
|
64
|
+
</goals>
|
|
65
|
+
<configuration>
|
|
66
|
+
<failOnViolation>true</failOnViolation>
|
|
67
|
+
<minimumTokens>100</minimumTokens>
|
|
68
|
+
</configuration>
|
|
69
|
+
</execution>
|
|
70
|
+
</executions>
|
|
71
|
+
<dependencies>
|
|
72
|
+
<dependency>
|
|
73
|
+
<groupId>com.alibaba.p3c</groupId>
|
|
74
|
+
<artifactId>p3c-pmd</artifactId>
|
|
75
|
+
<version>2.1.1</version>
|
|
76
|
+
</dependency>
|
|
77
|
+
</dependencies>
|
|
78
|
+
</plugin>
|
|
79
|
+
</plugins>
|
|
80
|
+
</build>
|
|
81
|
+
</profile>
|