@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,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-002
|
|
3
|
+
name: 规范for循环中计数器常量使用
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000065
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
规范for循环中计数器常量使用
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000065。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Magic number in for loop"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-003
|
|
3
|
+
name: 避免一个语句中给多个变量赋值
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000066
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
避免一个语句中给多个变量赋值
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000066。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Multiple assignment readability"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-004
|
|
3
|
+
name: 不使用float/double进行精确数值计算
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000070
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
不使用float/double进行精确数值计算
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000070。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "PMD:AvoidDecimalLiteralsInBigDecimalConstructor"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-005
|
|
3
|
+
name: 调用String.substring时先进行长度判断
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000073
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
调用String.substring时先进行长度判断
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000073。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "IndexOutOfBoundsException prevention"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-006
|
|
3
|
+
name: 数据库表数值类型主键定义成Long
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000074
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
数据库表数值类型主键定义成Long
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000074。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Integer overflow prevention"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-007
|
|
3
|
+
name: 不能使用过时的类或方法
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000083
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
不能使用过时的类或方法
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000083。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "PMD:UseCorrectExceptionLogging"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-008
|
|
3
|
+
name: 禁止使用BigDecimal(double)构造方法
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000086
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
禁止使用BigDecimal(double)构造方法
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000086。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "PMD:AvoidDecimalLiteralsInBigDecimalConstructor"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-009
|
|
3
|
+
name: POJO类不要设定属性默认值
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000088
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
POJO类不要设定属性默认值
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000088。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Default value anti-pattern"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-010
|
|
3
|
+
name: 禁止POJO类同时存在isXxx和getXxx
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000091
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
禁止POJO类同时存在isXxx和getXxx
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000091。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Boolean property naming"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-011
|
|
3
|
+
name: 避免重复创建字符串对象
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000123
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
避免重复创建字符串对象
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000123。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "String literal reuse"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-012
|
|
3
|
+
name: 避免用对象访问类的静态变量和方法
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000125
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
避免用对象访问类的静态变量和方法
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000125。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Static access via instance"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-013
|
|
3
|
+
name: 避免定义未使用的局部变量/参数/私有方法
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000097
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
避免定义未使用的局部变量/参数/私有方法
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000097。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Dead code detection"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-014
|
|
3
|
+
name: 谨慎调用静态的Calendar/DateFormat
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000100
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
谨慎调用静态的Calendar/DateFormat
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000100。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "SpotBugs:STCAL_INVOKE_ON_STATIC_*"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-015
|
|
3
|
+
name: 在类型转换前进行数据类型检测
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000101
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
在类型转换前进行数据类型检测
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000101。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "ClassCastException prevention"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-016
|
|
3
|
+
name: 确保SQL拼装时查询条件有效性
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000112
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
确保SQL拼装时查询条件有效性
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000112。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "SQL injection prevention"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-017
|
|
3
|
+
name: 日期格式化年份统一使用小写y
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000063
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
日期格式化年份统一使用小写y
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000063。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "yyyy vs YYYY confusion"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: WC-STYLE-018
|
|
3
|
+
name: 避免变量在使用前被另一个赋值覆盖
|
|
4
|
+
severity: error # error=阻断, warning=警告
|
|
5
|
+
source: J000105
|
|
6
|
+
tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
|
|
7
|
+
category: wc-style
|
|
8
|
+
description: |
|
|
9
|
+
避免变量在使用前被另一个赋值覆盖
|
|
10
|
+
|
|
11
|
+
对应浩鲸规范 J000105。
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
|
|
15
|
+
pattern: TODO
|
|
16
|
+
|
|
17
|
+
notes: "Variable shadowing/overwrite"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install WhaleCloud Java Coding Standards into a Gradle project.
|
|
3
|
+
# Usage: bash scripts/install-gradle-whalecloud.sh [project_root]
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
7
|
+
PROJECT_ROOT="${1:-.}"
|
|
8
|
+
|
|
9
|
+
cd "$PROJECT_ROOT"
|
|
10
|
+
|
|
11
|
+
if [ ! -f "build.gradle" ] && [ ! -f "build.gradle.kts" ]; then
|
|
12
|
+
echo "❌ No build.gradle or build.gradle.kts found in $(pwd)"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
17
|
+
echo " XP-Gate: Installing WhaleCloud Java Coding Standards"
|
|
18
|
+
echo " for Gradle project"
|
|
19
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
GRADLE_FILE="build.gradle"
|
|
23
|
+
[ -f "build.gradle.kts" ] && GRADLE_FILE="build.gradle.kts"
|
|
24
|
+
|
|
25
|
+
if grep -q 'XP-GateWhalecloudCheck\|whalecloud-ruleset' "$GRADLE_FILE"; then
|
|
26
|
+
echo "✅ WhaleCloud standard already configured in $GRADLE_FILE"
|
|
27
|
+
echo ""
|
|
28
|
+
echo "To run: ./gradlew XP-GateWhalecloudCheck"
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
echo "Installing into $GRADLE_FILE..."
|
|
33
|
+
|
|
34
|
+
cat >> "$GRADLE_FILE" << 'APPEND'
|
|
35
|
+
|
|
36
|
+
// ─── XP-Gate: WhaleCloud Java Coding Standards ───
|
|
37
|
+
plugins {
|
|
38
|
+
id 'pmd'
|
|
39
|
+
id 'checkstyle'
|
|
40
|
+
id 'com.github.spotbugs' version '5.2.5'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
pmd {
|
|
44
|
+
consoleOutput = true
|
|
45
|
+
toolVersion = '7.7.0'
|
|
46
|
+
ruleSetFiles = files('config/pmd/whalecloud-ruleset.xml')
|
|
47
|
+
ruleSets = [
|
|
48
|
+
'/rulesets/java/ali-comment.xml',
|
|
49
|
+
'/rulesets/java/ali-concurrent.xml',
|
|
50
|
+
'/rulesets/java/ali-constant.xml',
|
|
51
|
+
'/rulesets/java/ali-exception.xml',
|
|
52
|
+
'/rulesets/java/ali-flowcontrol.xml',
|
|
53
|
+
'/rulesets/java/ali-naming.xml',
|
|
54
|
+
'/rulesets/java/ali-oop.xml',
|
|
55
|
+
'/rulesets/java/ali-orm.xml',
|
|
56
|
+
'/rulesets/java/ali-other.xml',
|
|
57
|
+
'/rulesets/java/ali-set.xml'
|
|
58
|
+
]
|
|
59
|
+
sourceSets = [sourceSets.main, sourceSets.test]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
checkstyle {
|
|
63
|
+
toolVersion = '10.21.3'
|
|
64
|
+
configFile = file('config/checkstyle/whalecloud-checkstyle.xml')
|
|
65
|
+
sourceSets = [sourceSets.main, sourceSets.test]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
spotbugs {
|
|
69
|
+
toolVersion = '4.7.3'
|
|
70
|
+
includeFilter = file('config/spotbugs/whalecloud-spotbugs.xml')
|
|
71
|
+
effort = 'max'
|
|
72
|
+
reportLevel = 'low'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
dependencies {
|
|
76
|
+
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
task XP-GateWhalecloudCheck {
|
|
80
|
+
description = 'Run WhaleCloud Java coding standard checks'
|
|
81
|
+
group = 'Verification'
|
|
82
|
+
dependsOn 'pmdMain', 'pmdTest', 'checkstyleMain', 'checkstyleTest', 'spotbugsMain'
|
|
83
|
+
}
|
|
84
|
+
APPEND
|
|
85
|
+
|
|
86
|
+
echo ""
|
|
87
|
+
echo "✅ WhaleCloud standard installed!"
|
|
88
|
+
echo ""
|
|
89
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
90
|
+
echo " Usage"
|
|
91
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
92
|
+
echo ""
|
|
93
|
+
echo " # Run WhaleCloud quality checks:"
|
|
94
|
+
echo " ./gradlew XP-GateWhalecloudCheck"
|
|
95
|
+
echo ""
|
|
96
|
+
echo " # This integrates into XP-Gate pre-commit Gate 1"
|
|
97
|
+
echo ""
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install WhaleCloud Java Coding Standards into a Maven project.
|
|
3
|
+
# Usage: bash scripts/install-maven-whalecloud.sh [project_root]
|
|
4
|
+
#
|
|
5
|
+
# This script:
|
|
6
|
+
# 1. Detects if pom.xml exists
|
|
7
|
+
# 2. Installs whalecloud config files (PMD/CheckStyle/SpotBugs rulesets)
|
|
8
|
+
# 3. Merges xp-gate-whalecloud-java profile into pom.xml
|
|
9
|
+
# 4. Outputs usage instructions
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
14
|
+
PROJECT_ROOT="${1:-.}"
|
|
15
|
+
|
|
16
|
+
cd "$PROJECT_ROOT"
|
|
17
|
+
|
|
18
|
+
if [ ! -f "pom.xml" ]; then
|
|
19
|
+
echo "❌ No pom.xml found in $(pwd)"
|
|
20
|
+
echo "This script requires a Maven project."
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
25
|
+
echo " XP-Gate: Installing WhaleCloud Java Coding Standards"
|
|
26
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
27
|
+
echo ""
|
|
28
|
+
echo "This adds 106 rules (74 mandatory + 32 recommended) on"
|
|
29
|
+
echo "top of p3c-pmd baseline (54 Alibaba rules)."
|
|
30
|
+
echo ""
|
|
31
|
+
|
|
32
|
+
# Step 1: Install config files
|
|
33
|
+
CONFIG_DIR="config"
|
|
34
|
+
mkdir -p "$CONFIG_DIR/pmd" "$CONFIG_DIR/checkstyle" "$CONFIG_DIR/spotbugs"
|
|
35
|
+
|
|
36
|
+
echo "Step 1: Installing rule configuration files..."
|
|
37
|
+
|
|
38
|
+
# PMD ruleset
|
|
39
|
+
if [ -f "$CONFIG_DIR/pmd/whalecloud-ruleset.xml" ]; then
|
|
40
|
+
echo " ✅ config/pmd/whalecloud-ruleset.xml already exists"
|
|
41
|
+
else
|
|
42
|
+
cat > "$CONFIG_DIR/pmd/whalecloud-ruleset.xml" << 'RULESET'
|
|
43
|
+
<?xml version="1.0"?>
|
|
44
|
+
<ruleset name="WhaleCloud Java Rules"
|
|
45
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
46
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
47
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
|
48
|
+
|
|
49
|
+
<description>WhaleCloud Java Coding Standards — Overlay Rules</description>
|
|
50
|
+
|
|
51
|
+
<!-- Collection: J000005 toArray(T[]) -->
|
|
52
|
+
<rule ref="category/java/bestpractices.xml/ArrayIsStoredDirectly"/>
|
|
53
|
+
|
|
54
|
+
<!-- Exception: J000042 Empty catch block -->
|
|
55
|
+
<rule ref="category/java/errorpractices.xml/EmptyCatchBlock"/>
|
|
56
|
+
<!-- Exception: J000044 Return from finally -->
|
|
57
|
+
<rule ref="category/java/errorpractices.xml/AvoidReturningFromFinallyBlock"/>
|
|
58
|
+
|
|
59
|
+
<!-- Style: J000070 BigDecimal double constructor -->
|
|
60
|
+
<rule ref="category/java/errorpractices.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
|
|
61
|
+
|
|
62
|
+
<!-- Logging: J000053 Logger format -->
|
|
63
|
+
<rule ref="category/java/bestpractices.xml/GuardLogStatement"/>
|
|
64
|
+
|
|
65
|
+
<!-- Resource: J000108 System.gc() -->
|
|
66
|
+
<rule ref="category/java/errorpractices.xml/DoNotCallGarbageCollectionExplicitly"/>
|
|
67
|
+
|
|
68
|
+
<!-- Style: J000100 Static Calendar/DateFormat -->
|
|
69
|
+
<rule ref="category/java/multithreading.xml/NonThreadSafeProperty"/>
|
|
70
|
+
|
|
71
|
+
<!-- Performance: J000124 Pattern compilation -->
|
|
72
|
+
<rule ref="category/java/performance.xml/AvoidInstanceofChecksInCatchClause"/>
|
|
73
|
+
|
|
74
|
+
<!-- Security: J000078 SQL injection -->
|
|
75
|
+
<rule ref="category/java/security.xml/MethodRequiresCheck"/>
|
|
76
|
+
|
|
77
|
+
<!-- TODO: Add custom rules for J-rules not covered by standard PMD rulesets -->
|
|
78
|
+
<!-- Custom rules via XPath will be added here as the plugin matures -->
|
|
79
|
+
|
|
80
|
+
</ruleset>
|
|
81
|
+
RULESET
|
|
82
|
+
echo " ✅ Created config/pmd/whalecloud-ruleset.xml"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
# CheckStyle configuration
|
|
86
|
+
if [ -f "$CONFIG_DIR/checkstyle/whalecloud-checkstyle.xml" ]; then
|
|
87
|
+
echo " ✅ config/checkstyle/whalecloud-checkstyle.xml already exists"
|
|
88
|
+
else
|
|
89
|
+
cat > "$CONFIG_DIR/checkstyle/whalecloud-checkstyle.xml" << 'CHECKSTYLE'
|
|
90
|
+
<?xml version="1.0"?>
|
|
91
|
+
<!DOCTYPE module PUBLIC
|
|
92
|
+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
|
93
|
+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
|
94
|
+
<module name="Checker">
|
|
95
|
+
<module name="TreeWalker">
|
|
96
|
+
<!-- J000065: Magic number in for loop counter -->
|
|
97
|
+
<module name="MagicNumber">
|
|
98
|
+
<property name="ignoreNumbers" value="-1,0,1,2,10,100,1000,60,24,7,30,365,256,1024"/>
|
|
99
|
+
<property name="ignoreAnnotationElementDefaults" value="true"/>
|
|
100
|
+
</module>
|
|
101
|
+
<!-- J000030: Braces in control statements -->
|
|
102
|
+
<module name="NeedBraces"/>
|
|
103
|
+
<!-- J000066: Multiple variable assignment -->
|
|
104
|
+
<module name="MultipleVariableDeclarations"/>
|
|
105
|
+
<!-- J000072: Left side equals comparison -->
|
|
106
|
+
<module name="EqualsAvoidNull"/>
|
|
107
|
+
<!-- J000097: Unused local variables -->
|
|
108
|
+
<module name="UnusedLocalVariable"/>
|
|
109
|
+
</module>
|
|
110
|
+
</module>
|
|
111
|
+
CHECKSTYLE
|
|
112
|
+
echo " ✅ Created config/checkstyle/whalecloud-checkstyle.xml"
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# SpotBugs configuration
|
|
116
|
+
if [ -f "$CONFIG_DIR/spotbugs/whalecloud-spotbugs.xml" ]; then
|
|
117
|
+
echo " ✅ config/spotbugs/whalecloud-spotbugs.xml already exists"
|
|
118
|
+
else
|
|
119
|
+
cat > "$CONFIG_DIR/spotbugs/whalecloud-spotbugs.xml" << 'SPOTBUGS'
|
|
120
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
121
|
+
<FindBugsFilter>
|
|
122
|
+
<!-- J000017: SimpleDateFormat static usage -->
|
|
123
|
+
<Match>
|
|
124
|
+
<Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
|
|
125
|
+
</Match>
|
|
126
|
+
<Match>
|
|
127
|
+
<Bug pattern="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE"/>
|
|
128
|
+
</Match>
|
|
129
|
+
<!-- J000075: MD5 usage -->
|
|
130
|
+
<Match>
|
|
131
|
+
<Bug pattern="WEAK_MESSAGE_DIGEST_MD5"/>
|
|
132
|
+
</Match>
|
|
133
|
+
<!-- Security: SQL injection -->
|
|
134
|
+
<Match>
|
|
135
|
+
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_STATEMENT"/>
|
|
136
|
+
</Match>
|
|
137
|
+
<!-- Security: Command injection -->
|
|
138
|
+
<Match>
|
|
139
|
+
<Bug pattern="COMMAND_INJECTION"/>
|
|
140
|
+
</Match>
|
|
141
|
+
</FindBugsFilter>
|
|
142
|
+
SPOTBUGS
|
|
143
|
+
echo " ✅ Created config/spotbugs/whalecloud-spotbugs.xml"
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
echo ""
|
|
147
|
+
|
|
148
|
+
# Step 2: Install Maven profile
|
|
149
|
+
PROFILE_FILE="$PLUGIN_DIR/templates/maven/xp-gate-whalecloud-profile.xml"
|
|
150
|
+
|
|
151
|
+
if grep -q '<id>xp-gate-whalecloud-java</id>' pom.xml; then
|
|
152
|
+
echo "Step 2: xp-gate-whalecloud-java profile already exists in pom.xml"
|
|
153
|
+
else
|
|
154
|
+
echo "Step 2: Installing xp-gate-whalecloud-java profile into pom.xml..."
|
|
155
|
+
|
|
156
|
+
if grep -q '<profiles>' pom.xml; then
|
|
157
|
+
PROFILES_END_LINE=$(grep -n '</profiles>' pom.xml | head -1 | cut -d: -f1)
|
|
158
|
+
if [ -n "$PROFILES_END_LINE" ]; then
|
|
159
|
+
head -n $((PROFILES_END_LINE - 1)) pom.xml > pom.xml.tmp
|
|
160
|
+
{
|
|
161
|
+
echo ""
|
|
162
|
+
echo " <!-- XP-Gate: WhaleCloud Java Coding Standards profile -->"
|
|
163
|
+
sed 's/^/ /' "$PROFILE_FILE"
|
|
164
|
+
echo ""
|
|
165
|
+
} >> pom.xml.tmp
|
|
166
|
+
tail -n +"$PROFILES_END_LINE" pom.xml >> pom.xml.tmp
|
|
167
|
+
mv pom.xml.tmp pom.xml
|
|
168
|
+
fi
|
|
169
|
+
else
|
|
170
|
+
PROJECT_END_LINE=$(grep -n '</project>' pom.xml | tail -1 | cut -d: -f1)
|
|
171
|
+
if [ -n "$PROJECT_END_LINE" ]; then
|
|
172
|
+
head -n $((PROJECT_END_LINE - 1)) pom.xml > pom.xml.tmp
|
|
173
|
+
{
|
|
174
|
+
echo ""
|
|
175
|
+
echo " <!-- XP-Gate: WhaleCloud Java Coding Standards profile -->"
|
|
176
|
+
echo " <profiles>"
|
|
177
|
+
sed 's/^/ /' "$PROFILE_FILE"
|
|
178
|
+
echo ""
|
|
179
|
+
echo " </profiles>"
|
|
180
|
+
echo ""
|
|
181
|
+
} >> pom.xml.tmp
|
|
182
|
+
tail -n +"$PROJECT_END_LINE" pom.xml >> pom.xml.tmp
|
|
183
|
+
mv pom.xml.tmp pom.xml
|
|
184
|
+
fi
|
|
185
|
+
fi
|
|
186
|
+
echo " ✅ Profile installed successfully"
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
echo ""
|
|
190
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
191
|
+
echo " Usage"
|
|
192
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
193
|
+
echo ""
|
|
194
|
+
echo " # Run WhaleCloud Java quality checks:"
|
|
195
|
+
echo " mvn clean verify -P xp-gate-whalecloud-java"
|
|
196
|
+
echo ""
|
|
197
|
+
echo " # Run with both p3c-pmd and WhaleCloud:"
|
|
198
|
+
echo " mvn clean verify -P xp-gate-p3c,xp-gate-whalecloud-java"
|
|
199
|
+
echo ""
|
|
200
|
+
echo " # This will be integrated into XP-Gate pre-commit Gate 1"
|
|
201
|
+
echo ""
|