@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,73 @@
|
|
|
1
|
+
// WhaleCloud Java Coding Standards Gradle config for XP-Gate.
|
|
2
|
+
// Layered on top of p3c-pmd baseline — adds 74 mandatory + 32 recommended
|
|
3
|
+
// WhaleCloud-internal rules not covered by Alibaba p3c-pmd.
|
|
4
|
+
//
|
|
5
|
+
// Usage:
|
|
6
|
+
// ./gradlew XP-GateWhalecloudCheck
|
|
7
|
+
//
|
|
8
|
+
// Depends on: p3c-pmd config (XP-GateP3cCheck) must also be active.
|
|
9
|
+
|
|
10
|
+
plugins {
|
|
11
|
+
id 'java'
|
|
12
|
+
id 'pmd'
|
|
13
|
+
id 'checkstyle'
|
|
14
|
+
id 'com.github.spotbugs' version '5.2.5'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// PMD configuration: p3c-pmd baseline + WhaleCloud overlay
|
|
18
|
+
pmd {
|
|
19
|
+
consoleOutput = true
|
|
20
|
+
toolVersion = '7.7.0'
|
|
21
|
+
ruleSetFiles = files(
|
|
22
|
+
'config/pmd/whalecloud-ruleset.xml'
|
|
23
|
+
)
|
|
24
|
+
ruleSets = [
|
|
25
|
+
'/rulesets/java/ali-comment.xml',
|
|
26
|
+
'/rulesets/java/ali-concurrent.xml',
|
|
27
|
+
'/rulesets/java/ali-constant.xml',
|
|
28
|
+
'/rulesets/java/ali-exception.xml',
|
|
29
|
+
'/rulesets/java/ali-flowcontrol.xml',
|
|
30
|
+
'/rulesets/java/ali-naming.xml',
|
|
31
|
+
'/rulesets/java/ali-oop.xml',
|
|
32
|
+
'/rulesets/java/ali-orm.xml',
|
|
33
|
+
'/rulesets/java/ali-other.xml',
|
|
34
|
+
'/rulesets/java/ali-set.xml'
|
|
35
|
+
]
|
|
36
|
+
sourceSets = [sourceSets.main, sourceSets.test]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// CheckStyle with WhaleCloud customized ruleset
|
|
40
|
+
checkstyle {
|
|
41
|
+
toolVersion = '10.21.3'
|
|
42
|
+
configFile = file('config/checkstyle/whalecloud-checkstyle.xml')
|
|
43
|
+
sourceSets = [sourceSets.main, sourceSets.test]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// SpotBugs + FindSecBugs for security analysis
|
|
47
|
+
spotbugs {
|
|
48
|
+
toolVersion = '4.7.3'
|
|
49
|
+
includeFilter = file('config/spotbugs/whalecloud-spotbugs.xml')
|
|
50
|
+
effort = 'max'
|
|
51
|
+
reportLevel = 'low'
|
|
52
|
+
sourceSets = [sourceSets.main]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
dependencies {
|
|
56
|
+
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Combined WhaleCloud check task
|
|
60
|
+
task XP-GateWhalecloudCheck {
|
|
61
|
+
description = 'Run all WhaleCloud Java coding standard checks (p3c-pmd + overlay + security)'
|
|
62
|
+
group = 'Verification'
|
|
63
|
+
dependsOn 'pmdMain', 'pmdTest', 'checkstyleMain', 'checkstyleTest', 'spotbugsMain'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Install script: copies config files from plugin to project
|
|
67
|
+
def whalecloudConfigDir = "${projectDir}/config"
|
|
68
|
+
task installWhalecloudConfig(type: Copy) {
|
|
69
|
+
from "${pluginDir}/templates/gradle/config/"
|
|
70
|
+
into whalecloudConfigDir
|
|
71
|
+
description = 'Install WhaleCloud rule configuration files into project'
|
|
72
|
+
group = 'XP-Gate'
|
|
73
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
WhaleCloud Java Coding Standards Maven profile for XP-Gate.
|
|
4
|
+
Layered on top of p3c-pmd baseline — adds 74 mandatory + 32 recommended
|
|
5
|
+
WhaleCloud-internal rules not covered by Alibaba p3c-pmd.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
mvn clean verify -P XP-Gate-whalecloud-java
|
|
9
|
+
mvn clean verify -P XP-Gate-whalecloud-java -Dpmd.failOnViolation=true
|
|
10
|
+
|
|
11
|
+
Depends on: p3c-pmd profile (XP-Gate-p3c) must also be active.
|
|
12
|
+
|
|
13
|
+
Rules covered: 106 rules across 8 categories
|
|
14
|
+
- wc-collection: 集合处理增强 (12 条)
|
|
15
|
+
- wc-concurrent: 并发编程增强 (14 条)
|
|
16
|
+
- wc-exception: 异常处理规范 (11 条)
|
|
17
|
+
- wc-logging: 日志输出规范 (7 条)
|
|
18
|
+
- wc-security: 安全管理规范 (10 条)
|
|
19
|
+
- wc-resource: 资源管理规范 (6 条)
|
|
20
|
+
- wc-style: 编码风格规范 (18 条)
|
|
21
|
+
- wc-performance: 性能优化规范 (8 条)
|
|
22
|
+
-->
|
|
23
|
+
<profile>
|
|
24
|
+
<id>XP-Gate-whalecloud-java</id>
|
|
25
|
+
<activation>
|
|
26
|
+
<file>
|
|
27
|
+
<exists>${project.basedir}/src/main</exists>
|
|
28
|
+
</file>
|
|
29
|
+
</activation>
|
|
30
|
+
<build>
|
|
31
|
+
<plugins>
|
|
32
|
+
<!-- PMD with custom WhaleCloud ruleset (extends p3c-pmd) -->
|
|
33
|
+
<plugin>
|
|
34
|
+
<groupId>org.apache.maven.plugins</groupId>
|
|
35
|
+
<artifactId>maven-pmd-plugin</artifactId>
|
|
36
|
+
<version>3.21.2</version>
|
|
37
|
+
<configuration>
|
|
38
|
+
<targetJdk>${java.version}</targetJdk>
|
|
39
|
+
<rulesets>
|
|
40
|
+
<!-- BASELINE: Alibaba p3c-pmd (54 rules) -->
|
|
41
|
+
<ruleset>/rulesets/java/ali-comment.xml</ruleset>
|
|
42
|
+
<ruleset>/rulesets/java/ali-concurrent.xml</ruleset>
|
|
43
|
+
<ruleset>/rulesets/java/ali-constant.xml</ruleset>
|
|
44
|
+
<ruleset>/rulesets/java/ali-exception.xml</ruleset>
|
|
45
|
+
<ruleset>/rulesets/java/ali-flowcontrol.xml</ruleset>
|
|
46
|
+
<ruleset>/rulesets/java/ali-naming.xml</ruleset>
|
|
47
|
+
<ruleset>/rulesets/java/ali-oop.xml</ruleset>
|
|
48
|
+
<ruleset>/rulesets/java/ali-orm.xml</ruleset>
|
|
49
|
+
<ruleset>/rulesets/java/ali-other.xml</ruleset>
|
|
50
|
+
<ruleset>/rulesets/java/ali-set.xml</ruleset>
|
|
51
|
+
<!-- OVERLAY: WhaleCloud custom rules -->
|
|
52
|
+
<ruleset>${project.basedir}/config/pmd/whalecloud-ruleset.xml</ruleset>
|
|
53
|
+
</rulesets>
|
|
54
|
+
<printFailingErrors>true</printFailingErrors>
|
|
55
|
+
<failOnViolation>true</failOnViolation>
|
|
56
|
+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
|
57
|
+
<outputEncoding>UTF-8</outputEncoding>
|
|
58
|
+
<analysisCache>true</analysisCache>
|
|
59
|
+
<maxWarnings>0</maxWarnings>
|
|
60
|
+
</configuration>
|
|
61
|
+
<executions>
|
|
62
|
+
<execution>
|
|
63
|
+
<id>whalecloud-pmd-check</id>
|
|
64
|
+
<phase>verify</phase>
|
|
65
|
+
<goals>
|
|
66
|
+
<goal>check</goal>
|
|
67
|
+
</goals>
|
|
68
|
+
<configuration>
|
|
69
|
+
<failOnViolation>${pmd.failOnViolation}</failOnViolation>
|
|
70
|
+
</configuration>
|
|
71
|
+
</execution>
|
|
72
|
+
<execution>
|
|
73
|
+
<id>whalecloud-cpd-check</id>
|
|
74
|
+
<phase>verify</phase>
|
|
75
|
+
<goals>
|
|
76
|
+
<goal>cpd-check</goal>
|
|
77
|
+
</goals>
|
|
78
|
+
<configuration>
|
|
79
|
+
<failOnViolation>true</failOnViolation>
|
|
80
|
+
<minimumTokens>100</minimumTokens>
|
|
81
|
+
</configuration>
|
|
82
|
+
</execution>
|
|
83
|
+
</executions>
|
|
84
|
+
<dependencies>
|
|
85
|
+
<!-- p3c-pmd baseline -->
|
|
86
|
+
<dependency>
|
|
87
|
+
<groupId>com.alibaba.p3c</groupId>
|
|
88
|
+
<artifactId>p3c-pmd</artifactId>
|
|
89
|
+
<version>2.1.1</version>
|
|
90
|
+
</dependency>
|
|
91
|
+
</dependencies>
|
|
92
|
+
</plugin>
|
|
93
|
+
|
|
94
|
+
<!-- CheckStyle with WhaleCloud customized ruleset -->
|
|
95
|
+
<plugin>
|
|
96
|
+
<groupId>org.apache.maven.plugins</groupId>
|
|
97
|
+
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
98
|
+
<version>3.3.1</version>
|
|
99
|
+
<configuration>
|
|
100
|
+
<configLocation>${project.basedir}/config/checkstyle/whalecloud-checkstyle.xml</configLocation>
|
|
101
|
+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
|
102
|
+
<consoleOutput>true</consoleOutput>
|
|
103
|
+
<failsOnError>true</failsOnError>
|
|
104
|
+
<linkXRef>false</linkXRef>
|
|
105
|
+
</configuration>
|
|
106
|
+
<executions>
|
|
107
|
+
<execution>
|
|
108
|
+
<id>whalecloud-checkstyle</id>
|
|
109
|
+
<phase>verify</phase>
|
|
110
|
+
<goals>
|
|
111
|
+
<goal>check</goal>
|
|
112
|
+
</goals>
|
|
113
|
+
</execution>
|
|
114
|
+
</executions>
|
|
115
|
+
</plugin>
|
|
116
|
+
|
|
117
|
+
<!-- SpotBugs + FindSecBugs for security analysis -->
|
|
118
|
+
<plugin>
|
|
119
|
+
<groupId>com.github.spotbugs</groupId>
|
|
120
|
+
<artifactId>spotbugs-maven-plugin</artifactId>
|
|
121
|
+
<version>4.7.3.5</version>
|
|
122
|
+
<configuration>
|
|
123
|
+
<includeFilterFile>${project.basedir}/config/spotbugs/whalecloud-spotbugs.xml</includeFilterFile>
|
|
124
|
+
<effort>Max</effort>
|
|
125
|
+
<threshold>Low</threshold>
|
|
126
|
+
<failOnError>true</failOnError>
|
|
127
|
+
<includeTests>false</includeTests>
|
|
128
|
+
</configuration>
|
|
129
|
+
<executions>
|
|
130
|
+
<execution>
|
|
131
|
+
<id>whalecloud-spotbugs</id>
|
|
132
|
+
<phase>verify</phase>
|
|
133
|
+
<goals>
|
|
134
|
+
<goal>check</goal>
|
|
135
|
+
</goals>
|
|
136
|
+
</execution>
|
|
137
|
+
</executions>
|
|
138
|
+
<dependencies>
|
|
139
|
+
<dependency>
|
|
140
|
+
<groupId>com.h3xstream.findsecbugs</groupId>
|
|
141
|
+
<artifactId>findsecbugs-plugin</artifactId>
|
|
142
|
+
<version>1.12.0</version>
|
|
143
|
+
</dependency>
|
|
144
|
+
</dependencies>
|
|
145
|
+
</plugin>
|
|
146
|
+
</plugins>
|
|
147
|
+
</build>
|
|
148
|
+
</profile>
|
package/bin/xp-gate.js
CHANGED
|
@@ -7,57 +7,96 @@ const { uninstall } = require('../lib/uninstall.js');
|
|
|
7
7
|
const { doctor } = require('../lib/doctor.js');
|
|
8
8
|
const { checkDeps } = require('../lib/detect-deps.js');
|
|
9
9
|
const { migrate } = require('../lib/migrate.js');
|
|
10
|
+
const { handleBaseline } = require('../lib/baseline.js');
|
|
11
|
+
|
|
12
|
+
function handleUIReview() {
|
|
13
|
+
const { execSync } = require('child_process');
|
|
14
|
+
const uiReviewPath = path.join(__dirname, '..', 'lib', 'ui-review.ts');
|
|
15
|
+
try {
|
|
16
|
+
execSync(`npx -y tsx "${uiReviewPath}"`, { stdio: 'inherit' });
|
|
17
|
+
process.exit(0);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
10
22
|
|
|
11
23
|
const COMMANDS = {
|
|
12
24
|
'init': {
|
|
13
25
|
description: 'Initialize xp-gate (use --global for all projects)',
|
|
14
|
-
|
|
26
|
+
run: subargs => init(subargs).then(code => process.exit(code)),
|
|
15
27
|
usage: 'xp-gate init [--global]'
|
|
16
28
|
},
|
|
17
29
|
'setup-global': {
|
|
18
30
|
description: 'Set up xp-gate globally for all git projects',
|
|
19
|
-
|
|
31
|
+
run: () => init(['--global']).then(code => process.exit(code)),
|
|
20
32
|
usage: 'xp-gate setup-global'
|
|
21
33
|
},
|
|
22
34
|
'install-skill': {
|
|
23
35
|
description: 'Install a xp-gate skill from GitHub',
|
|
24
|
-
|
|
36
|
+
run: subargs => {
|
|
37
|
+
const name = subargs[0];
|
|
38
|
+
if (!name) {
|
|
39
|
+
console.error('Error: Skill name required');
|
|
40
|
+
console.error('Usage: xp-gate install-skill <name>[@<version>]');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const options = parseOptions(subargs.slice(1));
|
|
44
|
+
installSkill(name, options).then(code => process.exit(code));
|
|
45
|
+
},
|
|
25
46
|
usage: 'xp-gate install-skill <name>[@<version>] [--offline] [--verbose] [--force]'
|
|
26
47
|
},
|
|
27
48
|
'update-skill': {
|
|
28
49
|
description: 'Update installed skill(s)',
|
|
29
|
-
|
|
50
|
+
run: subargs => {
|
|
51
|
+
const name = subargs[0];
|
|
52
|
+
const options = parseOptions(subargs.slice(1));
|
|
53
|
+
updateSkill(name, options).then(code => process.exit(code));
|
|
54
|
+
},
|
|
30
55
|
usage: 'xp-gate update-skill [<name>] [--all] [--check]'
|
|
31
56
|
},
|
|
32
57
|
'uninstall-skill': {
|
|
33
58
|
description: 'Uninstall a xp-gate skill',
|
|
34
|
-
|
|
59
|
+
run: subargs => {
|
|
60
|
+
const name = subargs[0];
|
|
61
|
+
if (!name) {
|
|
62
|
+
console.error('Error: Skill name required');
|
|
63
|
+
console.error('Usage: xp-gate uninstall-skill <name>');
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
const options = parseOptions(subargs.slice(1));
|
|
67
|
+
uninstallSkill(name, options).then(code => process.exit(code));
|
|
68
|
+
},
|
|
35
69
|
usage: 'xp-gate uninstall-skill <name> [--force]'
|
|
36
70
|
},
|
|
37
71
|
'uninstall': {
|
|
38
72
|
description: 'Uninstall xp-gate (reverse of init)',
|
|
39
|
-
|
|
73
|
+
run: subargs => uninstall(subargs).then(code => process.exit(code)),
|
|
40
74
|
usage: 'xp-gate uninstall [--dry-run] [--force] [--local|--global]'
|
|
41
75
|
},
|
|
42
76
|
'migrate': {
|
|
43
77
|
description: 'Migrate from v0.4.x (GitHub Packages) to v0.5.x (public npm)',
|
|
44
|
-
|
|
78
|
+
run: subargs => migrate(subargs).then(code => process.exit(code)),
|
|
45
79
|
usage: 'xp-gate migrate [--dry-run]'
|
|
46
80
|
},
|
|
47
81
|
'doctor': {
|
|
48
82
|
description: 'Diagnose xp-gate installation health',
|
|
49
|
-
|
|
83
|
+
run: subargs => doctor(subargs).then(code => process.exit(code)),
|
|
50
84
|
usage: 'xp-gate doctor [--fix]'
|
|
51
85
|
},
|
|
52
86
|
'ui-review': {
|
|
53
87
|
description: 'Run UI review for non-sprint developers (generates .ui-gate-result.json)',
|
|
54
|
-
|
|
88
|
+
run: () => handleUIReview(),
|
|
55
89
|
usage: 'xp-gate ui-review'
|
|
56
90
|
},
|
|
57
91
|
'audit': {
|
|
58
92
|
description: 'Gate audit logging (record, --tail, --stats)',
|
|
59
|
-
|
|
93
|
+
run: subargs => handleAudit(subargs),
|
|
60
94
|
usage: 'xp-gate audit [--tail [N]|--stats|record --gate-id X --gate-name Y ...]'
|
|
95
|
+
},
|
|
96
|
+
'baseline': {
|
|
97
|
+
description: 'Manage lint baselines (create, show, reset, diff)',
|
|
98
|
+
run: subargs => handleBaseline(subargs).then(code => process.exit(code)),
|
|
99
|
+
usage: 'xp-gate baseline <create|show|reset|diff>'
|
|
61
100
|
}
|
|
62
101
|
};
|
|
63
102
|
|
|
@@ -92,151 +131,94 @@ function main() {
|
|
|
92
131
|
|
|
93
132
|
const command = args[0];
|
|
94
133
|
const subargs = args.slice(1);
|
|
134
|
+
const cmd = COMMANDS[command];
|
|
95
135
|
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
136
|
+
if (!cmd) {
|
|
137
|
+
console.error(`Unknown command: ${command}`);
|
|
138
|
+
printHelp();
|
|
139
|
+
process.exit(1);
|
|
99
140
|
return;
|
|
100
141
|
}
|
|
101
142
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
143
|
+
cmd.run(subargs);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handleAuditTail(args, auditPath) {
|
|
147
|
+
const tailIdx = args.indexOf('--tail');
|
|
148
|
+
const count = parseInt(args[tailIdx + 1] || '20', 10);
|
|
149
|
+
try {
|
|
150
|
+
const { readTailEntries } = require(auditPath);
|
|
151
|
+
const entries = readTailEntries(count);
|
|
152
|
+
if (entries.length === 0) {
|
|
153
|
+
console.log('No audit entries found.');
|
|
108
154
|
return;
|
|
109
155
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
156
|
+
printAuditTable(entries);
|
|
157
|
+
} catch (err) {
|
|
158
|
+
console.error('Error reading audit entries:', err.message);
|
|
159
|
+
process.exit(1);
|
|
113
160
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (command === 'uninstall-skill') {
|
|
123
|
-
const name = subargs[0];
|
|
124
|
-
if (!name) {
|
|
125
|
-
console.error('Error: Skill name required');
|
|
126
|
-
console.error('Usage: xp-gate uninstall-skill <name>');
|
|
127
|
-
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function handleAuditStats(auditPath) {
|
|
164
|
+
try {
|
|
165
|
+
const { computeStats } = require(auditPath);
|
|
166
|
+
const stats = computeStats();
|
|
167
|
+
if (stats.length === 0) {
|
|
168
|
+
console.log('No audit data found.');
|
|
128
169
|
return;
|
|
129
170
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (command === 'uninstall') {
|
|
136
|
-
uninstall(subargs).then(code => process.exit(code));
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (command === 'migrate') {
|
|
141
|
-
migrate(subargs).then(code => process.exit(code));
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (command === 'doctor') {
|
|
146
|
-
doctor(subargs).then(code => process.exit(code));
|
|
147
|
-
return;
|
|
171
|
+
printStatsTable(stats);
|
|
172
|
+
} catch (err) {
|
|
173
|
+
console.error('Error computing stats:', err.message);
|
|
174
|
+
process.exit(1);
|
|
148
175
|
}
|
|
176
|
+
}
|
|
149
177
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
function handleAuditRecord(args, auditPath) {
|
|
179
|
+
try {
|
|
180
|
+
const { appendAuditEntry } = require(auditPath);
|
|
181
|
+
const rest = args.slice(1);
|
|
182
|
+
const opts = {};
|
|
183
|
+
for (let i = 0; i < rest.length; i++) {
|
|
184
|
+
if (rest[i].startsWith('--') && i + 1 < rest.length) {
|
|
185
|
+
opts[rest[i].slice(2)] = rest[i + 1];
|
|
186
|
+
i++;
|
|
187
|
+
}
|
|
159
188
|
}
|
|
189
|
+
const entry = {
|
|
190
|
+
timestamp: new Date().toISOString(),
|
|
191
|
+
gate_id: opts['gate-id'] || 'unknown',
|
|
192
|
+
gate_name: opts['gate-name'] || 'unknown',
|
|
193
|
+
passed: opts['passed'] === 'true',
|
|
194
|
+
issues_found: parseInt(opts['issues-found'] || '0', 10),
|
|
195
|
+
duration_ms: parseInt(opts['duration-ms'] || '0', 10),
|
|
196
|
+
trigger: opts['trigger'] || 'manual',
|
|
197
|
+
repo_path: process.cwd(),
|
|
198
|
+
commit_hash: opts['commit-hash'] || 'HEAD',
|
|
199
|
+
};
|
|
200
|
+
appendAuditEntry(entry);
|
|
201
|
+
} catch (err) {
|
|
202
|
+
console.error('Error recording audit entry:', err.message);
|
|
203
|
+
process.exit(1);
|
|
160
204
|
}
|
|
161
|
-
|
|
162
|
-
if (command === 'audit') {
|
|
163
|
-
handleAudit(subargs);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
console.error(`Unknown command: ${command}`);
|
|
168
|
-
printHelp();
|
|
169
|
-
process.exit(1);
|
|
170
205
|
}
|
|
171
206
|
|
|
172
207
|
function handleAudit(args) {
|
|
173
|
-
const path = require('path');
|
|
174
208
|
const auditPath = path.join(__dirname, '..', 'lib', 'gate-audit.ts');
|
|
175
209
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (tailIdx !== -1) {
|
|
179
|
-
const count = parseInt(args[tailIdx + 1] || '20', 10);
|
|
180
|
-
try {
|
|
181
|
-
const { readTailEntries } = require(auditPath);
|
|
182
|
-
const entries = readTailEntries(count);
|
|
183
|
-
if (entries.length === 0) {
|
|
184
|
-
console.log('No audit entries found.');
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
printAuditTable(entries);
|
|
188
|
-
} catch (err) {
|
|
189
|
-
console.error('Error reading audit entries:', err.message);
|
|
190
|
-
process.exit(1);
|
|
191
|
-
}
|
|
210
|
+
if (args.includes('--tail')) {
|
|
211
|
+
handleAuditTail(args, auditPath);
|
|
192
212
|
return;
|
|
193
213
|
}
|
|
194
214
|
|
|
195
|
-
// --stats
|
|
196
215
|
if (args.includes('--stats')) {
|
|
197
|
-
|
|
198
|
-
const { computeStats } = require(auditPath);
|
|
199
|
-
const stats = computeStats();
|
|
200
|
-
if (stats.length === 0) {
|
|
201
|
-
console.log('No audit data found.');
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
printStatsTable(stats);
|
|
205
|
-
} catch (err) {
|
|
206
|
-
console.error('Error computing stats:', err.message);
|
|
207
|
-
process.exit(1);
|
|
208
|
-
}
|
|
216
|
+
handleAuditStats(auditPath);
|
|
209
217
|
return;
|
|
210
218
|
}
|
|
211
219
|
|
|
212
|
-
// record --gate-id X --gate-name Y --passed true/false ...
|
|
213
220
|
if (args[0] === 'record') {
|
|
214
|
-
|
|
215
|
-
const { appendAuditEntry } = require(auditPath);
|
|
216
|
-
const rest = args.slice(1);
|
|
217
|
-
const opts = {};
|
|
218
|
-
for (let i = 0; i < rest.length; i++) {
|
|
219
|
-
if (rest[i].startsWith('--') && i + 1 < rest.length) {
|
|
220
|
-
opts[rest[i].slice(2)] = rest[i + 1];
|
|
221
|
-
i++;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
const entry = {
|
|
225
|
-
timestamp: new Date().toISOString(),
|
|
226
|
-
gate_id: opts['gate-id'] || 'unknown',
|
|
227
|
-
gate_name: opts['gate-name'] || 'unknown',
|
|
228
|
-
passed: opts['passed'] === 'true',
|
|
229
|
-
issues_found: parseInt(opts['issues-found'] || '0', 10),
|
|
230
|
-
duration_ms: parseInt(opts['duration-ms'] || '0', 10),
|
|
231
|
-
trigger: opts['trigger'] || 'manual',
|
|
232
|
-
repo_path: process.cwd(),
|
|
233
|
-
commit_hash: opts['commit-hash'] || 'HEAD',
|
|
234
|
-
};
|
|
235
|
-
appendAuditEntry(entry);
|
|
236
|
-
} catch (err) {
|
|
237
|
-
console.error('Error recording audit entry:', err.message);
|
|
238
|
-
process.exit(1);
|
|
239
|
-
}
|
|
221
|
+
handleAuditRecord(args, auditPath);
|
|
240
222
|
return;
|
|
241
223
|
}
|
|
242
224
|
|
package/hooks/pre-commit
CHANGED
|
@@ -32,14 +32,15 @@ source "$ADAPTER_DIR/adapter-common.sh" 2>/dev/null || {
|
|
|
32
32
|
# Trap: ensure quality report generated on ANY exit (pass or fail).
|
|
33
33
|
# Using a guard prevents recursion when 'exit' is called from inside the trap.
|
|
34
34
|
_QUALITY_REPORT_DONE=0
|
|
35
|
-
_quality_report_on_exit() {
|
|
35
|
+
_quality_report_on_exit() {
|
|
36
|
+
local _saved_exit=$?
|
|
36
37
|
if [ "$_QUALITY_REPORT_DONE" = "1" ]; then
|
|
37
|
-
exit
|
|
38
|
+
exit $_saved_exit
|
|
38
39
|
return
|
|
39
40
|
fi
|
|
40
41
|
_QUALITY_REPORT_DONE=1
|
|
41
|
-
generate_quality_report
|
|
42
|
-
exit
|
|
42
|
+
command -v generate_quality_report >/dev/null 2>&1 && generate_quality_report 2>/dev/null || true
|
|
43
|
+
exit $_saved_exit
|
|
43
44
|
}
|
|
44
45
|
trap '_quality_report_on_exit' EXIT
|
|
45
46
|
|
|
@@ -576,7 +577,6 @@ elif [ "$PROJECT_LANG" = "powershell" ]; then
|
|
|
576
577
|
|
|
577
578
|
else
|
|
578
579
|
CCN_THRESHOLD=5
|
|
579
|
-
CCN_ERROR_THRESHOLD=10 # Changed from 15 to 10 as per standard practice
|
|
580
580
|
|
|
581
581
|
# Check lizard availability
|
|
582
582
|
LIZARD_CMD=""
|
|
@@ -603,22 +603,12 @@ else
|
|
|
603
603
|
CC_WARNINGS=$(echo "$CC_OUTPUT" | grep "^Warning cnt" | awk '{print $NF}' | tr -d '[:space:]' | sed 's/[^0-9]//g' || true)
|
|
604
604
|
CC_WARNINGS=${CC_WARNINGS:-0}
|
|
605
605
|
|
|
606
|
-
# Count functions with CCN > CCN_ERROR_THRESHOLD (these block)
|
|
607
|
-
CC_ERRORS=$(echo "$CC_OUTPUT" | awk 'NF>=6 && $2 ~ /^[0-9]+$/ && $NF ~ /@/ && $2+0 > '"$CCN_ERROR_THRESHOLD"'' | sort -u -k5,5 | wc -l)
|
|
608
|
-
|
|
609
|
-
if [ "$CC_ERRORS" -gt 0 ]; then
|
|
610
|
-
echo "$CC_OUTPUT"
|
|
611
|
-
echo ""
|
|
612
|
-
echo "❌ BLOCKED - Functions with CCN > $CCN_ERROR_THRESHOLD found."
|
|
613
|
-
echo "Refactor high-complexity functions to keep below $CCN_ERROR_THRESHOLD complexity."
|
|
614
|
-
exit
|
|
615
|
-
fi
|
|
616
|
-
|
|
617
606
|
if [ "$CC_WARNINGS" -gt 0 ]; then
|
|
618
607
|
echo "$CC_OUTPUT"
|
|
619
608
|
echo ""
|
|
620
|
-
echo "
|
|
621
|
-
echo "
|
|
609
|
+
echo "❌ BLOCKED - $CC_WARNINGS functions with CCN > $CCN_THRESHOLD found."
|
|
610
|
+
echo "Refactor high-complexity functions to keep below $CCN_THRESHOLD complexity."
|
|
611
|
+
exit 1
|
|
622
612
|
else
|
|
623
613
|
echo "✅ PASSED - All functions within complexity threshold ($CCN_THRESHOLD)."
|
|
624
614
|
fi
|
|
@@ -1104,19 +1094,33 @@ elif [ "$PROJECT_LANG" = "powershell" ]; then
|
|
|
1104
1094
|
|
|
1105
1095
|
else
|
|
1106
1096
|
# Check if architecture config exists
|
|
1107
|
-
if [ -f "architecture.yaml" ] || [ -f ".architecturerc" ]; then
|
|
1097
|
+
if [ -f "architecture.yaml" ] || [ -f ".architecturerc" ] || [ -f ".archlint.yaml" ]; then
|
|
1108
1098
|
# Different architecture tools per language
|
|
1109
1099
|
case "$PROJECT_LANG" in
|
|
1110
1100
|
"typescript")
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1101
|
+
# Try local npx install first (devDependencies), fall back to global
|
|
1102
|
+
if npx --no-install @archlinter/cli --version >/dev/null 2>&1; then
|
|
1103
|
+
ARCHLINT_CMD="npx --no-install @archlinter/cli"
|
|
1104
|
+
elif command -v archlint >/dev/null 2>&1; then
|
|
1105
|
+
ARCHLINT_CMD="archlint"
|
|
1106
|
+
elif npx @archlinter/cli --version >/dev/null 2>&1; then
|
|
1107
|
+
ARCHLINT_CMD="npx @archlinter/cli"
|
|
1115
1108
|
else
|
|
1116
|
-
echo "
|
|
1117
|
-
|
|
1118
|
-
|
|
1109
|
+
echo " ❌ BLOCKED - archlint not installed"
|
|
1110
|
+
echo " Install with: npm install --save-dev @archlinter/cli"
|
|
1111
|
+
exit 1
|
|
1112
|
+
fi
|
|
1113
|
+
echo " Running archlint for TypeScript..."
|
|
1114
|
+
ARCHLINT_OUTPUT=$($ARCHLINT_CMD scan . -f table --quiet 2>&1)
|
|
1115
|
+
ARCHLINT_EXIT=$?
|
|
1116
|
+
echo "$ARCHLINT_OUTPUT" | tail -30
|
|
1117
|
+
if [ "$ARCHLINT_EXIT" -ne 0 ]; then
|
|
1118
|
+
echo ""
|
|
1119
|
+
echo "❌ BLOCKED - Architecture violations detected"
|
|
1120
|
+
echo "Fix the architecture violations above before committing."
|
|
1121
|
+
exit 1
|
|
1119
1122
|
fi
|
|
1123
|
+
echo " ✅ TypeScript architecture validation completed."
|
|
1120
1124
|
;;
|
|
1121
1125
|
"python")
|
|
1122
1126
|
if [ -f ".import-linter.yml" ] || [ -f "import_linter_config.yml" ]; then
|
|
@@ -1584,7 +1588,7 @@ generate_quality_report() {
|
|
|
1584
1588
|
"name": "Cyclomatic Complexity",
|
|
1585
1589
|
"status": "${GATE_3_STATUS:-PASS}",
|
|
1586
1590
|
"threshold": "${CCN_THRESHOLD:-5}",
|
|
1587
|
-
"
|
|
1591
|
+
"blockThreshold": "${CCN_THRESHOLD:-5}",
|
|
1588
1592
|
"warnings": ${CC_WARNINGS:-0}
|
|
1589
1593
|
},
|
|
1590
1594
|
"gate4_principles": {
|
package/hooks/pre-push
CHANGED
|
@@ -21,7 +21,11 @@ URL="$2"
|
|
|
21
21
|
PUSHED_FILES=""
|
|
22
22
|
TS_FILES=""
|
|
23
23
|
while read local_ref local_sha remote_ref remote_sha; do
|
|
24
|
-
if [ "$
|
|
24
|
+
if [ "$local_sha" = "0000000000000000000000000000000000000000" ]; then
|
|
25
|
+
# Branch deletion - skip validation entirely
|
|
26
|
+
echo " ℹ️ Branch deletion detected ($local_ref). Skipping validation."
|
|
27
|
+
continue
|
|
28
|
+
elif [ "$remote_sha" = "0000000000000000000000000000000000000000" ]; then
|
|
25
29
|
# New branch - compare against empty tree
|
|
26
30
|
PUSHED_FILES=$(git diff-tree -r --name-only HEAD)
|
|
27
31
|
TS_FILES=$(git diff-tree -r --name-only HEAD | grep '\.ts$' || true)
|
|
@@ -115,9 +119,9 @@ else
|
|
|
115
119
|
if [[ ! -f "src/mutation/gate-m.ts" ]]; then
|
|
116
120
|
echo "⚠️ Gate M script (src/mutation/gate-m.ts) not found. SKIP — Gate M."
|
|
117
121
|
else
|
|
118
|
-
# Run mutation gate with
|
|
122
|
+
# Run mutation gate with timeout matching stryker.conf.json (timeoutMS: 600000 = 10min)
|
|
119
123
|
MUTATION_OUTPUT=$(mktemp)
|
|
120
|
-
timeout
|
|
124
|
+
timeout 600s npx tsx src/mutation/gate-m.ts --changed-files "$CHANGED_SOURCE_FILES" > "$MUTATION_OUTPUT" 2>&1
|
|
121
125
|
MUTATION_EXIT=$?
|
|
122
126
|
|
|
123
127
|
case $MUTATION_EXIT in
|