@opensip-cli/checks-universal 0.1.0
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/all-checks-execute.test.d.ts +17 -0
- package/dist/__tests__/all-checks-execute.test.d.ts.map +1 -0
- package/dist/__tests__/all-checks-execute.test.js +452 -0
- package/dist/__tests__/all-checks-execute.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-10.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-10.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-10.test.js +200 -0
- package/dist/__tests__/behavior-fixtures-10.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-11.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-11.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-11.test.js +120 -0
- package/dist/__tests__/behavior-fixtures-11.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-12.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-12.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-12.test.js +157 -0
- package/dist/__tests__/behavior-fixtures-12.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-2.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-2.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-2.test.js +785 -0
- package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-3.test.d.ts +6 -0
- package/dist/__tests__/behavior-fixtures-3.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-3.test.js +663 -0
- package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-4.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-4.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-4.test.js +612 -0
- package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-5.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-5.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-5.test.js +469 -0
- package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-6.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-6.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-6.test.js +591 -0
- package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-7.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-7.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-7.test.js +662 -0
- package/dist/__tests__/behavior-fixtures-7.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-8.test.d.ts +11 -0
- package/dist/__tests__/behavior-fixtures-8.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-8.test.js +634 -0
- package/dist/__tests__/behavior-fixtures-8.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-9.test.d.ts +11 -0
- package/dist/__tests__/behavior-fixtures-9.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-9.test.js +271 -0
- package/dist/__tests__/behavior-fixtures-9.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures.test.d.ts +14 -0
- package/dist/__tests__/behavior-fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures.test.js +1423 -0
- package/dist/__tests__/behavior-fixtures.test.js.map +1 -0
- package/dist/__tests__/checks.test.d.ts +2 -0
- package/dist/__tests__/checks.test.d.ts.map +1 -0
- package/dist/__tests__/checks.test.js +61 -0
- package/dist/__tests__/checks.test.js.map +1 -0
- package/dist/__tests__/env-var-validation.test.d.ts +14 -0
- package/dist/__tests__/env-var-validation.test.d.ts.map +1 -0
- package/dist/__tests__/env-var-validation.test.js +53 -0
- package/dist/__tests__/env-var-validation.test.js.map +1 -0
- package/dist/__tests__/file-length-limit.test.d.ts +2 -0
- package/dist/__tests__/file-length-limit.test.d.ts.map +1 -0
- package/dist/__tests__/file-length-limit.test.js +29 -0
- package/dist/__tests__/file-length-limit.test.js.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts +18 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.js +35 -0
- package/dist/__tests__/fixture-coverage.allowlist.js.map +1 -0
- package/dist/__tests__/fixture-coverage.test.d.ts +13 -0
- package/dist/__tests__/fixture-coverage.test.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.test.js +57 -0
- package/dist/__tests__/fixture-coverage.test.js.map +1 -0
- package/dist/__tests__/iic.test.d.ts +15 -0
- package/dist/__tests__/iic.test.d.ts.map +1 -0
- package/dist/__tests__/iic.test.js +316 -0
- package/dist/__tests__/iic.test.js.map +1 -0
- package/dist/__tests__/no-skipped-tests.test.d.ts +14 -0
- package/dist/__tests__/no-skipped-tests.test.d.ts.map +1 -0
- package/dist/__tests__/no-skipped-tests.test.js +144 -0
- package/dist/__tests__/no-skipped-tests.test.js.map +1 -0
- package/dist/__tests__/no-todo-comments.test.d.ts +2 -0
- package/dist/__tests__/no-todo-comments.test.d.ts.map +1 -0
- package/dist/__tests__/no-todo-comments.test.js +31 -0
- package/dist/__tests__/no-todo-comments.test.js.map +1 -0
- package/dist/__tests__/no-unimplemented-markers.test.d.ts +2 -0
- package/dist/__tests__/no-unimplemented-markers.test.d.ts.map +1 -0
- package/dist/__tests__/no-unimplemented-markers.test.js +140 -0
- package/dist/__tests__/no-unimplemented-markers.test.js.map +1 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.d.ts +10 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.d.ts.map +1 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.js +176 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.js.map +1 -0
- package/dist/__tests__/resilience-fp.test.d.ts +14 -0
- package/dist/__tests__/resilience-fp.test.d.ts.map +1 -0
- package/dist/__tests__/resilience-fp.test.js +110 -0
- package/dist/__tests__/resilience-fp.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js +32 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.js +152 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js +129 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js.map +1 -0
- package/dist/checks/architecture/_yaml-doc-bindings.d.ts +23 -0
- package/dist/checks/architecture/_yaml-doc-bindings.d.ts.map +1 -0
- package/dist/checks/architecture/_yaml-doc-bindings.js +29 -0
- package/dist/checks/architecture/_yaml-doc-bindings.js.map +1 -0
- package/dist/checks/architecture/dependencies/index.d.ts +2 -0
- package/dist/checks/architecture/dependencies/index.d.ts.map +1 -0
- package/dist/checks/architecture/dependencies/index.js +2 -0
- package/dist/checks/architecture/dependencies/index.js.map +1 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts +11 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts.map +1 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.js +171 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.js.map +1 -0
- package/dist/checks/architecture/docker-best-practices.d.ts +23 -0
- package/dist/checks/architecture/docker-best-practices.d.ts.map +1 -0
- package/dist/checks/architecture/docker-best-practices.js +427 -0
- package/dist/checks/architecture/docker-best-practices.js.map +1 -0
- package/dist/checks/architecture/docker-ignore-validation.d.ts +18 -0
- package/dist/checks/architecture/docker-ignore-validation.d.ts.map +1 -0
- package/dist/checks/architecture/docker-ignore-validation.js +117 -0
- package/dist/checks/architecture/docker-ignore-validation.js.map +1 -0
- package/dist/checks/architecture/docker-version-sync.d.ts +16 -0
- package/dist/checks/architecture/docker-version-sync.d.ts.map +1 -0
- package/dist/checks/architecture/docker-version-sync.js +193 -0
- package/dist/checks/architecture/docker-version-sync.js.map +1 -0
- package/dist/checks/architecture/env-var-validation.d.ts +14 -0
- package/dist/checks/architecture/env-var-validation.d.ts.map +1 -0
- package/dist/checks/architecture/env-var-validation.js +289 -0
- package/dist/checks/architecture/env-var-validation.js.map +1 -0
- package/dist/checks/architecture/heavy-import-detection.d.ts +11 -0
- package/dist/checks/architecture/heavy-import-detection.d.ts.map +1 -0
- package/dist/checks/architecture/heavy-import-detection.js +91 -0
- package/dist/checks/architecture/heavy-import-detection.js.map +1 -0
- package/dist/checks/architecture/index.d.ts +16 -0
- package/dist/checks/architecture/index.d.ts.map +1 -0
- package/dist/checks/architecture/index.js +16 -0
- package/dist/checks/architecture/index.js.map +1 -0
- package/dist/checks/architecture/modules/empty-package-detection.d.ts +11 -0
- package/dist/checks/architecture/modules/empty-package-detection.d.ts.map +1 -0
- package/dist/checks/architecture/modules/empty-package-detection.js +277 -0
- package/dist/checks/architecture/modules/empty-package-detection.js.map +1 -0
- package/dist/checks/architecture/modules/index.d.ts +3 -0
- package/dist/checks/architecture/modules/index.d.ts.map +1 -0
- package/dist/checks/architecture/modules/index.js +3 -0
- package/dist/checks/architecture/modules/index.js.map +1 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts +12 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts.map +1 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.js +555 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.js.map +1 -0
- package/dist/checks/architecture/no-custom-event-emitter.d.ts +11 -0
- package/dist/checks/architecture/no-custom-event-emitter.d.ts.map +1 -0
- package/dist/checks/architecture/no-custom-event-emitter.js +123 -0
- package/dist/checks/architecture/no-custom-event-emitter.js.map +1 -0
- package/dist/checks/architecture/no-kebab-option-indexing.d.ts +33 -0
- package/dist/checks/architecture/no-kebab-option-indexing.d.ts.map +1 -0
- package/dist/checks/architecture/no-kebab-option-indexing.js +81 -0
- package/dist/checks/architecture/no-kebab-option-indexing.js.map +1 -0
- package/dist/checks/architecture/node-version-consistency.d.ts +22 -0
- package/dist/checks/architecture/node-version-consistency.d.ts.map +1 -0
- package/dist/checks/architecture/node-version-consistency.js +225 -0
- package/dist/checks/architecture/node-version-consistency.js.map +1 -0
- package/dist/checks/architecture/project-readme-existence.d.ts +13 -0
- package/dist/checks/architecture/project-readme-existence.d.ts.map +1 -0
- package/dist/checks/architecture/project-readme-existence.js +55 -0
- package/dist/checks/architecture/project-readme-existence.js.map +1 -0
- package/dist/checks/architecture/stale-build-artifacts.d.ts +10 -0
- package/dist/checks/architecture/stale-build-artifacts.d.ts.map +1 -0
- package/dist/checks/architecture/stale-build-artifacts.js +55 -0
- package/dist/checks/architecture/stale-build-artifacts.js.map +1 -0
- package/dist/checks/architecture/tool-has-manifest.d.ts +27 -0
- package/dist/checks/architecture/tool-has-manifest.d.ts.map +1 -0
- package/dist/checks/architecture/tool-has-manifest.js +135 -0
- package/dist/checks/architecture/tool-has-manifest.js.map +1 -0
- package/dist/checks/architecture/vitest-config-extends-base.d.ts +15 -0
- package/dist/checks/architecture/vitest-config-extends-base.d.ts.map +1 -0
- package/dist/checks/architecture/vitest-config-extends-base.js +104 -0
- package/dist/checks/architecture/vitest-config-extends-base.js.map +1 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.d.ts +49 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.d.ts.map +1 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.js +199 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.js.map +1 -0
- package/dist/checks/documentation/_directives/eslint.d.ts +9 -0
- package/dist/checks/documentation/_directives/eslint.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/eslint.js +168 -0
- package/dist/checks/documentation/_directives/eslint.js.map +1 -0
- package/dist/checks/documentation/_directives/fitness.d.ts +9 -0
- package/dist/checks/documentation/_directives/fitness.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/fitness.js +64 -0
- package/dist/checks/documentation/_directives/fitness.js.map +1 -0
- package/dist/checks/documentation/_directives/graph.d.ts +10 -0
- package/dist/checks/documentation/_directives/graph.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/graph.js +65 -0
- package/dist/checks/documentation/_directives/graph.js.map +1 -0
- package/dist/checks/documentation/_directives/graph.test.d.ts +2 -0
- package/dist/checks/documentation/_directives/graph.test.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/graph.test.js +54 -0
- package/dist/checks/documentation/_directives/graph.test.js.map +1 -0
- package/dist/checks/documentation/_directives/semgrep.d.ts +8 -0
- package/dist/checks/documentation/_directives/semgrep.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/semgrep.js +72 -0
- package/dist/checks/documentation/_directives/semgrep.js.map +1 -0
- package/dist/checks/documentation/_directives/types.d.ts +21 -0
- package/dist/checks/documentation/_directives/types.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/types.js +9 -0
- package/dist/checks/documentation/_directives/types.js.map +1 -0
- package/dist/checks/documentation/_directives/typescript.d.ts +10 -0
- package/dist/checks/documentation/_directives/typescript.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/typescript.js +54 -0
- package/dist/checks/documentation/_directives/typescript.js.map +1 -0
- package/dist/checks/documentation/_public-api-graph.d.ts +30 -0
- package/dist/checks/documentation/_public-api-graph.d.ts.map +1 -0
- package/dist/checks/documentation/_public-api-graph.js +304 -0
- package/dist/checks/documentation/_public-api-graph.js.map +1 -0
- package/dist/checks/documentation/directive-audit.d.ts +26 -0
- package/dist/checks/documentation/directive-audit.d.ts.map +1 -0
- package/dist/checks/documentation/directive-audit.js +144 -0
- package/dist/checks/documentation/directive-audit.js.map +1 -0
- package/dist/checks/documentation/index.d.ts +3 -0
- package/dist/checks/documentation/index.d.ts.map +1 -0
- package/dist/checks/documentation/index.js +3 -0
- package/dist/checks/documentation/index.js.map +1 -0
- package/dist/checks/documentation/public-api-jsdoc.d.ts +10 -0
- package/dist/checks/documentation/public-api-jsdoc.d.ts.map +1 -0
- package/dist/checks/documentation/public-api-jsdoc.js +131 -0
- package/dist/checks/documentation/public-api-jsdoc.js.map +1 -0
- package/dist/checks/file-length-limit.d.ts +16 -0
- package/dist/checks/file-length-limit.d.ts.map +1 -0
- package/dist/checks/file-length-limit.js +47 -0
- package/dist/checks/file-length-limit.js.map +1 -0
- package/dist/checks/index.d.ts +16 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +16 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/no-todo-comments.d.ts +18 -0
- package/dist/checks/no-todo-comments.d.ts.map +1 -0
- package/dist/checks/no-todo-comments.js +79 -0
- package/dist/checks/no-todo-comments.js.map +1 -0
- package/dist/checks/no-unimplemented-markers.d.ts +24 -0
- package/dist/checks/no-unimplemented-markers.d.ts.map +1 -0
- package/dist/checks/no-unimplemented-markers.js +198 -0
- package/dist/checks/no-unimplemented-markers.js.map +1 -0
- package/dist/checks/quality/api/graphql-offset-pagination.d.ts +9 -0
- package/dist/checks/quality/api/graphql-offset-pagination.d.ts.map +1 -0
- package/dist/checks/quality/api/graphql-offset-pagination.js +63 -0
- package/dist/checks/quality/api/graphql-offset-pagination.js.map +1 -0
- package/dist/checks/quality/api/index.d.ts +3 -0
- package/dist/checks/quality/api/index.d.ts.map +1 -0
- package/dist/checks/quality/api/index.js +3 -0
- package/dist/checks/quality/api/index.js.map +1 -0
- package/dist/checks/quality/api/zod-openapi-sync.d.ts +13 -0
- package/dist/checks/quality/api/zod-openapi-sync.d.ts.map +1 -0
- package/dist/checks/quality/api/zod-openapi-sync.js +88 -0
- package/dist/checks/quality/api/zod-openapi-sync.js.map +1 -0
- package/dist/checks/quality/code-structure/dead-code.d.ts +12 -0
- package/dist/checks/quality/code-structure/dead-code.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/dead-code.js +238 -0
- package/dist/checks/quality/code-structure/dead-code.js.map +1 -0
- package/dist/checks/quality/code-structure/index.d.ts +5 -0
- package/dist/checks/quality/code-structure/index.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/index.js +5 -0
- package/dist/checks/quality/code-structure/index.js.map +1 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.d.ts +25 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.js +76 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.js.map +1 -0
- package/dist/checks/quality/code-structure/no-console-log.d.ts +17 -0
- package/dist/checks/quality/code-structure/no-console-log.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-console-log.js +106 -0
- package/dist/checks/quality/code-structure/no-console-log.js.map +1 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.d.ts +25 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.js +104 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.js.map +1 -0
- package/dist/checks/quality/dependency-version-consistency.d.ts +20 -0
- package/dist/checks/quality/dependency-version-consistency.d.ts.map +1 -0
- package/dist/checks/quality/dependency-version-consistency.js +266 -0
- package/dist/checks/quality/dependency-version-consistency.js.map +1 -0
- package/dist/checks/quality/fitness-ignore-hygiene.d.ts +10 -0
- package/dist/checks/quality/fitness-ignore-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/fitness-ignore-hygiene.js +93 -0
- package/dist/checks/quality/fitness-ignore-hygiene.js.map +1 -0
- package/dist/checks/quality/frontend/expo-vector-icons.d.ts +13 -0
- package/dist/checks/quality/frontend/expo-vector-icons.d.ts.map +1 -0
- package/dist/checks/quality/frontend/expo-vector-icons.js +80 -0
- package/dist/checks/quality/frontend/expo-vector-icons.js.map +1 -0
- package/dist/checks/quality/frontend/image-optimization.d.ts +13 -0
- package/dist/checks/quality/frontend/image-optimization.d.ts.map +1 -0
- package/dist/checks/quality/frontend/image-optimization.js +166 -0
- package/dist/checks/quality/frontend/image-optimization.js.map +1 -0
- package/dist/checks/quality/frontend/index.d.ts +4 -0
- package/dist/checks/quality/frontend/index.d.ts.map +1 -0
- package/dist/checks/quality/frontend/index.js +4 -0
- package/dist/checks/quality/frontend/index.js.map +1 -0
- package/dist/checks/quality/frontend/navigation-typing.d.ts +12 -0
- package/dist/checks/quality/frontend/navigation-typing.d.ts.map +1 -0
- package/dist/checks/quality/frontend/navigation-typing.js +77 -0
- package/dist/checks/quality/frontend/navigation-typing.js.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.d.ts +10 -0
- package/dist/checks/quality/graph-ignore-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.js +95 -0
- package/dist/checks/quality/graph-ignore-hygiene.js.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.d.ts +14 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.d.ts.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.js +58 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.js.map +1 -0
- package/dist/checks/quality/index.d.ts +16 -0
- package/dist/checks/quality/index.d.ts.map +1 -0
- package/dist/checks/quality/index.js +16 -0
- package/dist/checks/quality/index.js.map +1 -0
- package/dist/checks/quality/linting/eslint-justifications.d.ts +12 -0
- package/dist/checks/quality/linting/eslint-justifications.d.ts.map +1 -0
- package/dist/checks/quality/linting/eslint-justifications.js +328 -0
- package/dist/checks/quality/linting/eslint-justifications.js.map +1 -0
- package/dist/checks/quality/linting/index.d.ts +4 -0
- package/dist/checks/quality/linting/index.d.ts.map +1 -0
- package/dist/checks/quality/linting/index.js +4 -0
- package/dist/checks/quality/linting/index.js.map +1 -0
- package/dist/checks/quality/linting/semgrep-justifications.d.ts +16 -0
- package/dist/checks/quality/linting/semgrep-justifications.d.ts.map +1 -0
- package/dist/checks/quality/linting/semgrep-justifications.js +229 -0
- package/dist/checks/quality/linting/semgrep-justifications.js.map +1 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts +12 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.js +142 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.js.map +1 -0
- package/dist/checks/quality/no-compatibility-layer-names.d.ts +13 -0
- package/dist/checks/quality/no-compatibility-layer-names.d.ts.map +1 -0
- package/dist/checks/quality/no-compatibility-layer-names.js +100 -0
- package/dist/checks/quality/no-compatibility-layer-names.js.map +1 -0
- package/dist/checks/quality/no-deprecated-tags.d.ts +11 -0
- package/dist/checks/quality/no-deprecated-tags.d.ts.map +1 -0
- package/dist/checks/quality/no-deprecated-tags.js +76 -0
- package/dist/checks/quality/no-deprecated-tags.js.map +1 -0
- package/dist/checks/quality/no-markdown-references.d.ts +16 -0
- package/dist/checks/quality/no-markdown-references.d.ts.map +1 -0
- package/dist/checks/quality/no-markdown-references.js +145 -0
- package/dist/checks/quality/no-markdown-references.js.map +1 -0
- package/dist/checks/quality/no-raw-regex-on-code.d.ts +9 -0
- package/dist/checks/quality/no-raw-regex-on-code.d.ts.map +1 -0
- package/dist/checks/quality/no-raw-regex-on-code.js +61 -0
- package/dist/checks/quality/no-raw-regex-on-code.js.map +1 -0
- package/dist/checks/quality/no-temporary-workarounds.d.ts +11 -0
- package/dist/checks/quality/no-temporary-workarounds.d.ts.map +1 -0
- package/dist/checks/quality/no-temporary-workarounds.js +69 -0
- package/dist/checks/quality/no-temporary-workarounds.js.map +1 -0
- package/dist/checks/quality/no-window-alert.d.ts +19 -0
- package/dist/checks/quality/no-window-alert.d.ts.map +1 -0
- package/dist/checks/quality/no-window-alert.js +74 -0
- package/dist/checks/quality/no-window-alert.js.map +1 -0
- package/dist/checks/quality/observability/index.d.ts +2 -0
- package/dist/checks/quality/observability/index.d.ts.map +1 -0
- package/dist/checks/quality/observability/index.js +2 -0
- package/dist/checks/quality/observability/index.js.map +1 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.d.ts +15 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.d.ts.map +1 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.js +209 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.js.map +1 -0
- package/dist/checks/quality/patterns/async-state-pattern.d.ts +14 -0
- package/dist/checks/quality/patterns/async-state-pattern.d.ts.map +1 -0
- package/dist/checks/quality/patterns/async-state-pattern.js +80 -0
- package/dist/checks/quality/patterns/async-state-pattern.js.map +1 -0
- package/dist/checks/quality/patterns/index.d.ts +4 -0
- package/dist/checks/quality/patterns/index.d.ts.map +1 -0
- package/dist/checks/quality/patterns/index.js +4 -0
- package/dist/checks/quality/patterns/index.js.map +1 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.d.ts +10 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.d.ts.map +1 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.js +97 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.js.map +1 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.d.ts +16 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.d.ts.map +1 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.js +239 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.js.map +1 -0
- package/dist/checks/resilience/_helpers/config-validation.d.ts +27 -0
- package/dist/checks/resilience/_helpers/config-validation.d.ts.map +1 -0
- package/dist/checks/resilience/_helpers/config-validation.js +61 -0
- package/dist/checks/resilience/_helpers/config-validation.js.map +1 -0
- package/dist/checks/resilience/batch-operations.d.ts +22 -0
- package/dist/checks/resilience/batch-operations.d.ts.map +1 -0
- package/dist/checks/resilience/batch-operations.js +422 -0
- package/dist/checks/resilience/batch-operations.js.map +1 -0
- package/dist/checks/resilience/cache-ttl-validation.d.ts +13 -0
- package/dist/checks/resilience/cache-ttl-validation.d.ts.map +1 -0
- package/dist/checks/resilience/cache-ttl-validation.js +222 -0
- package/dist/checks/resilience/cache-ttl-validation.js.map +1 -0
- package/dist/checks/resilience/catch-clause-safety.d.ts +12 -0
- package/dist/checks/resilience/catch-clause-safety.d.ts.map +1 -0
- package/dist/checks/resilience/catch-clause-safety.js +110 -0
- package/dist/checks/resilience/catch-clause-safety.js.map +1 -0
- package/dist/checks/resilience/dangerous-config-defaults.d.ts +11 -0
- package/dist/checks/resilience/dangerous-config-defaults.d.ts.map +1 -0
- package/dist/checks/resilience/dangerous-config-defaults.js +304 -0
- package/dist/checks/resilience/dangerous-config-defaults.js.map +1 -0
- package/dist/checks/resilience/error-code-registration.d.ts +11 -0
- package/dist/checks/resilience/error-code-registration.d.ts.map +1 -0
- package/dist/checks/resilience/error-code-registration.js +88 -0
- package/dist/checks/resilience/error-code-registration.js.map +1 -0
- package/dist/checks/resilience/event-patterns.d.ts +21 -0
- package/dist/checks/resilience/event-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/event-patterns.js +232 -0
- package/dist/checks/resilience/event-patterns.js.map +1 -0
- package/dist/checks/resilience/exit-code-correctness.d.ts +12 -0
- package/dist/checks/resilience/exit-code-correctness.d.ts.map +1 -0
- package/dist/checks/resilience/exit-code-correctness.js +107 -0
- package/dist/checks/resilience/exit-code-correctness.js.map +1 -0
- package/dist/checks/resilience/index.d.ts +18 -0
- package/dist/checks/resilience/index.d.ts.map +1 -0
- package/dist/checks/resilience/index.js +18 -0
- package/dist/checks/resilience/index.js.map +1 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.d.ts +10 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.d.ts.map +1 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.js +291 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.js.map +1 -0
- package/dist/checks/resilience/no-process-exit-in-finally.d.ts +11 -0
- package/dist/checks/resilience/no-process-exit-in-finally.d.ts.map +1 -0
- package/dist/checks/resilience/no-process-exit-in-finally.js +89 -0
- package/dist/checks/resilience/no-process-exit-in-finally.js.map +1 -0
- package/dist/checks/resilience/readline-cleanup.d.ts +11 -0
- package/dist/checks/resilience/readline-cleanup.d.ts.map +1 -0
- package/dist/checks/resilience/readline-cleanup.js +107 -0
- package/dist/checks/resilience/readline-cleanup.js.map +1 -0
- package/dist/checks/resilience/recovery-patterns.d.ts +25 -0
- package/dist/checks/resilience/recovery-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/recovery-patterns.js +273 -0
- package/dist/checks/resilience/recovery-patterns.js.map +1 -0
- package/dist/checks/resilience/reentrancy-guard.d.ts +12 -0
- package/dist/checks/resilience/reentrancy-guard.d.ts.map +1 -0
- package/dist/checks/resilience/reentrancy-guard.js +86 -0
- package/dist/checks/resilience/reentrancy-guard.js.map +1 -0
- package/dist/checks/resilience/retry-config-validation.d.ts +13 -0
- package/dist/checks/resilience/retry-config-validation.d.ts.map +1 -0
- package/dist/checks/resilience/retry-config-validation.js +159 -0
- package/dist/checks/resilience/retry-config-validation.js.map +1 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.d.ts +25 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.js +68 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.js.map +1 -0
- package/dist/checks/resilience/sentry/index.d.ts +8 -0
- package/dist/checks/resilience/sentry/index.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/index.js +8 -0
- package/dist/checks/resilience/sentry/index.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.js +55 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.js +51 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.js +75 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts +13 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js +125 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-release-set.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-release-set.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-release-set.js +51 -0
- package/dist/checks/resilience/sentry/sentry-release-set.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.js +78 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.js +83 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.js.map +1 -0
- package/dist/checks/resilience/service-patterns.d.ts +18 -0
- package/dist/checks/resilience/service-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/service-patterns.js +230 -0
- package/dist/checks/resilience/service-patterns.js.map +1 -0
- package/dist/checks/resilience/timer-lifecycle.d.ts +10 -0
- package/dist/checks/resilience/timer-lifecycle.d.ts.map +1 -0
- package/dist/checks/resilience/timer-lifecycle.js +78 -0
- package/dist/checks/resilience/timer-lifecycle.js.map +1 -0
- package/dist/checks/resilience/transaction-patterns.d.ts +21 -0
- package/dist/checks/resilience/transaction-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/transaction-patterns.js +258 -0
- package/dist/checks/resilience/transaction-patterns.js.map +1 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts +9 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts.map +1 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js +37 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js.map +1 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts +2 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts.map +1 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.js +128 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.js.map +1 -0
- package/dist/checks/security/api-key-rotation.d.ts +10 -0
- package/dist/checks/security/api-key-rotation.d.ts.map +1 -0
- package/dist/checks/security/api-key-rotation.js +186 -0
- package/dist/checks/security/api-key-rotation.js.map +1 -0
- package/dist/checks/security/auth-middleware-coverage.d.ts +11 -0
- package/dist/checks/security/auth-middleware-coverage.d.ts.map +1 -0
- package/dist/checks/security/auth-middleware-coverage.js +210 -0
- package/dist/checks/security/auth-middleware-coverage.js.map +1 -0
- package/dist/checks/security/auth-route-guard.d.ts +12 -0
- package/dist/checks/security/auth-route-guard.d.ts.map +1 -0
- package/dist/checks/security/auth-route-guard.js +70 -0
- package/dist/checks/security/auth-route-guard.js.map +1 -0
- package/dist/checks/security/cors-configuration.d.ts +11 -0
- package/dist/checks/security/cors-configuration.d.ts.map +1 -0
- package/dist/checks/security/cors-configuration.js +126 -0
- package/dist/checks/security/cors-configuration.js.map +1 -0
- package/dist/checks/security/csp-headers.d.ts +11 -0
- package/dist/checks/security/csp-headers.d.ts.map +1 -0
- package/dist/checks/security/csp-headers.js +192 -0
- package/dist/checks/security/csp-headers.js.map +1 -0
- package/dist/checks/security/dependency-vulnerability-audit.d.ts +15 -0
- package/dist/checks/security/dependency-vulnerability-audit.d.ts.map +1 -0
- package/dist/checks/security/dependency-vulnerability-audit.js +184 -0
- package/dist/checks/security/dependency-vulnerability-audit.js.map +1 -0
- package/dist/checks/security/env-secret-exposure.d.ts +11 -0
- package/dist/checks/security/env-secret-exposure.d.ts.map +1 -0
- package/dist/checks/security/env-secret-exposure.js +127 -0
- package/dist/checks/security/env-secret-exposure.js.map +1 -0
- package/dist/checks/security/hasura-production-config.d.ts +11 -0
- package/dist/checks/security/hasura-production-config.d.ts.map +1 -0
- package/dist/checks/security/hasura-production-config.js +122 -0
- package/dist/checks/security/hasura-production-config.js.map +1 -0
- package/dist/checks/security/index.d.ts +17 -0
- package/dist/checks/security/index.d.ts.map +1 -0
- package/dist/checks/security/index.js +17 -0
- package/dist/checks/security/index.js.map +1 -0
- package/dist/checks/security/jwt-validation.d.ts +11 -0
- package/dist/checks/security/jwt-validation.d.ts.map +1 -0
- package/dist/checks/security/jwt-validation.js +294 -0
- package/dist/checks/security/jwt-validation.js.map +1 -0
- package/dist/checks/security/no-eval.d.ts +16 -0
- package/dist/checks/security/no-eval.d.ts.map +1 -0
- package/dist/checks/security/no-eval.js +83 -0
- package/dist/checks/security/no-eval.js.map +1 -0
- package/dist/checks/security/no-hardcoded-secrets.d.ts +28 -0
- package/dist/checks/security/no-hardcoded-secrets.d.ts.map +1 -0
- package/dist/checks/security/no-hardcoded-secrets.js +209 -0
- package/dist/checks/security/no-hardcoded-secrets.js.map +1 -0
- package/dist/checks/security/package-supply-chain-policy.d.ts +12 -0
- package/dist/checks/security/package-supply-chain-policy.d.ts.map +1 -0
- package/dist/checks/security/package-supply-chain-policy.js +534 -0
- package/dist/checks/security/package-supply-chain-policy.js.map +1 -0
- package/dist/checks/security/rate-limit-coverage.d.ts +10 -0
- package/dist/checks/security/rate-limit-coverage.d.ts.map +1 -0
- package/dist/checks/security/rate-limit-coverage.js +143 -0
- package/dist/checks/security/rate-limit-coverage.js.map +1 -0
- package/dist/checks/security/semgrep-scan.d.ts +13 -0
- package/dist/checks/security/semgrep-scan.d.ts.map +1 -0
- package/dist/checks/security/semgrep-scan.js +86 -0
- package/dist/checks/security/semgrep-scan.js.map +1 -0
- package/dist/checks/security/use-centralized-crypto.d.ts +11 -0
- package/dist/checks/security/use-centralized-crypto.d.ts.map +1 -0
- package/dist/checks/security/use-centralized-crypto.js +129 -0
- package/dist/checks/security/use-centralized-crypto.js.map +1 -0
- package/dist/checks/security/webhook-signature-verification.d.ts +10 -0
- package/dist/checks/security/webhook-signature-verification.d.ts.map +1 -0
- package/dist/checks/security/webhook-signature-verification.js +183 -0
- package/dist/checks/security/webhook-signature-verification.js.map +1 -0
- package/dist/checks/testing/index.d.ts +6 -0
- package/dist/checks/testing/index.d.ts.map +1 -0
- package/dist/checks/testing/index.js +6 -0
- package/dist/checks/testing/index.js.map +1 -0
- package/dist/checks/testing/no-skipped-tests.d.ts +40 -0
- package/dist/checks/testing/no-skipped-tests.d.ts.map +1 -0
- package/dist/checks/testing/no-skipped-tests.js +174 -0
- package/dist/checks/testing/no-skipped-tests.js.map +1 -0
- package/dist/checks/testing/no-stub-tests.d.ts +11 -0
- package/dist/checks/testing/no-stub-tests.d.ts.map +1 -0
- package/dist/checks/testing/no-stub-tests.js +103 -0
- package/dist/checks/testing/no-stub-tests.js.map +1 -0
- package/dist/checks/testing/test-convention-consistency.d.ts +14 -0
- package/dist/checks/testing/test-convention-consistency.d.ts.map +1 -0
- package/dist/checks/testing/test-convention-consistency.js +93 -0
- package/dist/checks/testing/test-convention-consistency.js.map +1 -0
- package/dist/checks/testing/test-file-naming.d.ts +13 -0
- package/dist/checks/testing/test-file-naming.d.ts.map +1 -0
- package/dist/checks/testing/test-file-naming.js +218 -0
- package/dist/checks/testing/test-file-naming.js.map +1 -0
- package/dist/checks/testing/test-file-pairing.d.ts +13 -0
- package/dist/checks/testing/test-file-pairing.d.ts.map +1 -0
- package/dist/checks/testing/test-file-pairing.js +274 -0
- package/dist/checks/testing/test-file-pairing.js.map +1 -0
- package/dist/display/architecture.d.ts +9 -0
- package/dist/display/architecture.d.ts.map +1 -0
- package/dist/display/architecture.js +29 -0
- package/dist/display/architecture.js.map +1 -0
- package/dist/display/index.d.ts +20 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +30 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/quality.d.ts +7 -0
- package/dist/display/quality.d.ts.map +1 -0
- package/dist/display/quality.js +34 -0
- package/dist/display/quality.js.map +1 -0
- package/dist/display/resilience.d.ts +7 -0
- package/dist/display/resilience.d.ts.map +1 -0
- package/dist/display/resilience.js +36 -0
- package/dist/display/resilience.js.map +1 -0
- package/dist/display/security-testing.d.ts +9 -0
- package/dist/display/security-testing.d.ts.map +1 -0
- package/dist/display/security-testing.js +31 -0
- package/dist/display/security-testing.js.map +1 -0
- package/dist/display/types.d.ts +6 -0
- package/dist/display/types.d.ts.map +1 -0
- package/dist/display/types.js +6 -0
- package/dist/display/types.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Validates test file naming conventions
|
|
3
|
+
*
|
|
4
|
+
* Test files should follow the pattern *.test.ts or *.spec.ts
|
|
5
|
+
* and be located in __tests__ directories.
|
|
6
|
+
*/
|
|
7
|
+
// @fitness-ignore-file fitness-check-standards -- Uses fs for directory listing/stat operations, not file content reading
|
|
8
|
+
import * as fs from 'node:fs';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { logger } from '@opensip-cli/core';
|
|
11
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
12
|
+
/**
|
|
13
|
+
* Valid test file patterns
|
|
14
|
+
*/
|
|
15
|
+
const VALID_TEST_PATTERNS = [
|
|
16
|
+
/\.test\.[jt]sx?$/,
|
|
17
|
+
/\.spec\.[jt]sx?$/,
|
|
18
|
+
/\.bench\.[jt]sx?$/, // Benchmark files
|
|
19
|
+
/\.contract\.[jt]sx?$/, // Contract test files
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Files/patterns to ignore (test utilities, helpers, setup files)
|
|
23
|
+
*/
|
|
24
|
+
const IGNORED_PATTERNS = [
|
|
25
|
+
/^_/, // Underscore-prefixed files are private helpers/runners by convention
|
|
26
|
+
/^setup\.[jt]sx?$/, // Test setup files
|
|
27
|
+
/^test-setup\.[jt]sx?$/, // Test setup files
|
|
28
|
+
/-test-setup\.[jt]sx?$/, // Test setup files with module prefix (e.g. git-worktree-test-setup.ts)
|
|
29
|
+
/^test-context\.[jt]sx?$/, // Test context files
|
|
30
|
+
/\.setup\.[jt]sx?$/, // Setup files with prefix
|
|
31
|
+
/^mock[-_]/, // Mock files
|
|
32
|
+
/^_mocks?\.[jt]sx?$/, // Underscore-prefix mock files (e.g. _mocks.ts)
|
|
33
|
+
/-mock\.[jt]sx?$/, // Mock files with suffix
|
|
34
|
+
/-mocks\.[jt]sx?$/, // Mock files with plural suffix
|
|
35
|
+
/[-_]helpers?\.[jt]sx?$/, // Helper files
|
|
36
|
+
/\.test\.helpers?\.[jt]sx?$/, // Test-only helper files (e.g. service.test.helpers.ts)
|
|
37
|
+
/[-_.]fixtures?\.[jt]sx?$/, // Fixture files (foo-fixtures.ts, catalog.fixture.ts, โฆ)
|
|
38
|
+
/[-_.]allowlist\.[jt]sx?$/, // Allowlist data modules (test config/data, not test cases)
|
|
39
|
+
/[-_]utils?\.[jt]sx?$/, // Utility files
|
|
40
|
+
/^services\.[jt]sx?$/, // Service mocks
|
|
41
|
+
/^index\.[jt]sx?$/, // Index files (re-exports)
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Directories to skip (build artifacts, etc.)
|
|
45
|
+
*
|
|
46
|
+
* `fixtures` / `__fixtures__` and `test-utils` are subdirectories used to
|
|
47
|
+
* host test inputs and per-package scope helpers โ their files don't follow
|
|
48
|
+
* `.test.ts` naming because they're not test files in the Vitest-discovery
|
|
49
|
+
* sense.
|
|
50
|
+
*/
|
|
51
|
+
const SKIP_DIRECTORIES = new Set([
|
|
52
|
+
'node_modules',
|
|
53
|
+
'dist',
|
|
54
|
+
'build',
|
|
55
|
+
'coverage',
|
|
56
|
+
'.turbo',
|
|
57
|
+
'fixtures',
|
|
58
|
+
'__fixtures__',
|
|
59
|
+
'test-utils',
|
|
60
|
+
]);
|
|
61
|
+
/**
|
|
62
|
+
* Directories to scan for tests
|
|
63
|
+
*/
|
|
64
|
+
const SCAN_DIRECTORIES = ['packages', 'services', 'apps', 'tools'];
|
|
65
|
+
function isPotentialTestFile(entry) {
|
|
66
|
+
logger.debug({
|
|
67
|
+
evt: 'fitness.checks.test_file_naming.is_potential_test_file',
|
|
68
|
+
msg: 'Checking if entry is a potential test file',
|
|
69
|
+
});
|
|
70
|
+
const isTypeScriptFile = entry.endsWith('.ts') || entry.endsWith('.tsx');
|
|
71
|
+
const isJavaScriptFile = entry.endsWith('.js') || entry.endsWith('.jsx');
|
|
72
|
+
const isDeclarationFile = entry.endsWith('.d.ts');
|
|
73
|
+
return (isTypeScriptFile || isJavaScriptFile) && !isDeclarationFile;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Recursively check __tests__ directory for naming violations
|
|
77
|
+
*/
|
|
78
|
+
function checkTestsDirectory(testsDir, cwd) {
|
|
79
|
+
logger.debug({
|
|
80
|
+
evt: 'fitness.checks.test_file_naming.check_tests_directory',
|
|
81
|
+
msg: 'Checking __tests__ directory for naming violations',
|
|
82
|
+
});
|
|
83
|
+
const violations = [];
|
|
84
|
+
try {
|
|
85
|
+
const entries = fs.readdirSync(testsDir);
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
const fullPath = path.join(testsDir, entry);
|
|
88
|
+
const stat = fs.statSync(fullPath);
|
|
89
|
+
if (stat.isFile() && isPotentialTestFile(entry)) {
|
|
90
|
+
// Skip files matching ignored patterns (helpers, setup, mocks, etc.)
|
|
91
|
+
const isIgnoredFile = IGNORED_PATTERNS.some((pattern) => pattern.test(entry));
|
|
92
|
+
if (isIgnoredFile)
|
|
93
|
+
continue;
|
|
94
|
+
// Check if file follows valid test pattern
|
|
95
|
+
const isValidTestFile = VALID_TEST_PATTERNS.some((pattern) => pattern.test(entry));
|
|
96
|
+
if (!isValidTestFile) {
|
|
97
|
+
const baseName = entry.replace(/\.[jt]sx?$/, '');
|
|
98
|
+
violations.push({
|
|
99
|
+
line: 1,
|
|
100
|
+
message: `Test file "${entry}" should end with .test.ts or .spec.ts`,
|
|
101
|
+
severity: 'warning',
|
|
102
|
+
type: 'wrong-naming',
|
|
103
|
+
suggestion: `Rename the file: mv ${entry} ${baseName}.test.ts (or ${baseName}.spec.ts)`,
|
|
104
|
+
match: entry,
|
|
105
|
+
filePath: fullPath,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else if (stat.isDirectory()) {
|
|
110
|
+
// Skip build artifact directories
|
|
111
|
+
if (SKIP_DIRECTORIES.has(entry))
|
|
112
|
+
continue;
|
|
113
|
+
// Recurse into subdirectories (like unit/, integration/, fixtures/, helpers/)
|
|
114
|
+
const subViolations = checkTestsDirectory(fullPath, cwd);
|
|
115
|
+
violations.push(...subViolations);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// @swallow-ok Ignore read errors
|
|
121
|
+
}
|
|
122
|
+
return violations;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Recursively scan directory for __tests__ folders
|
|
126
|
+
*/
|
|
127
|
+
function scanDirectory(dirPath, cwd) {
|
|
128
|
+
logger.debug({
|
|
129
|
+
evt: 'fitness.checks.test_file_naming.scan_directory',
|
|
130
|
+
msg: 'Scanning directory for __tests__ folders',
|
|
131
|
+
});
|
|
132
|
+
const violations = [];
|
|
133
|
+
try {
|
|
134
|
+
const entries = fs.readdirSync(dirPath);
|
|
135
|
+
for (const entry of entries) {
|
|
136
|
+
// Skip ignored directories (node_modules, dist, build, etc.)
|
|
137
|
+
if (SKIP_DIRECTORIES.has(entry) || entry.startsWith('.'))
|
|
138
|
+
continue;
|
|
139
|
+
const fullPath = path.join(dirPath, entry);
|
|
140
|
+
const stat = fs.statSync(fullPath);
|
|
141
|
+
if (!stat.isDirectory())
|
|
142
|
+
continue;
|
|
143
|
+
if (entry === '__tests__') {
|
|
144
|
+
// Found a __tests__ directory, check all files
|
|
145
|
+
const testViolations = checkTestsDirectory(fullPath, cwd);
|
|
146
|
+
violations.push(...testViolations);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Recurse into subdirectory
|
|
150
|
+
const subViolations = scanDirectory(fullPath, cwd);
|
|
151
|
+
violations.push(...subViolations);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// @swallow-ok Ignore read errors
|
|
157
|
+
}
|
|
158
|
+
return violations;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Analyze all files for test naming violations
|
|
162
|
+
*/
|
|
163
|
+
// @fitness-ignore-next-line concurrency-safety -- async keyword required by analyzeAll interface contract; synchronous analysis implementation
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/require-await -- AnalyzeAllCheckConfig requires Promise<CheckViolation[]>; this implementation is synchronous
|
|
165
|
+
async function analyzeAll(files) {
|
|
166
|
+
logger.debug({
|
|
167
|
+
evt: 'fitness.checks.test_file_naming.analyze_all',
|
|
168
|
+
msg: 'Analyzing all files for test naming violations',
|
|
169
|
+
});
|
|
170
|
+
// Get the cwd from the first file path (all paths are absolute)
|
|
171
|
+
const firstPath = files.paths[0];
|
|
172
|
+
if (!firstPath) {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
// Find the repo root by looking for packages directory
|
|
176
|
+
let cwd = path.dirname(firstPath);
|
|
177
|
+
while (cwd !== '/' && !fs.existsSync(path.join(cwd, 'packages'))) {
|
|
178
|
+
cwd = path.dirname(cwd);
|
|
179
|
+
}
|
|
180
|
+
const violations = [];
|
|
181
|
+
// Scan __tests__ directories
|
|
182
|
+
for (const dir of SCAN_DIRECTORIES) {
|
|
183
|
+
const dirPath = path.join(cwd, dir);
|
|
184
|
+
if (fs.existsSync(dirPath)) {
|
|
185
|
+
const dirViolations = scanDirectory(dirPath, cwd);
|
|
186
|
+
violations.push(...dirViolations);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return violations;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Check: testing/test-file-naming
|
|
193
|
+
*
|
|
194
|
+
* Validates test file naming conventions follow *.test.ts or *.spec.ts patterns.
|
|
195
|
+
*/
|
|
196
|
+
export const testFileNaming = defineCheck({
|
|
197
|
+
id: '7c26c9ae-2944-46e1-a49b-817b81aba0e6',
|
|
198
|
+
slug: 'test-file-naming',
|
|
199
|
+
scope: { languages: ['typescript', 'tsx'], concerns: ['testing'] },
|
|
200
|
+
contentFilter: 'strip-strings',
|
|
201
|
+
confidence: 'medium',
|
|
202
|
+
description: 'Validates test file naming conventions follow *.test.ts or *.spec.ts patterns',
|
|
203
|
+
longDescription: `**Purpose:** Ensures all files inside \`__tests__/\` directories follow recognized test file naming conventions so test runners can discover them.
|
|
204
|
+
|
|
205
|
+
**Detects:**
|
|
206
|
+
- Files in \`__tests__/\` directories that don't match \`.test.[jt]sx?\`, \`.spec.[jt]sx?\`, \`.bench.[jt]sx?\`, or \`.contract.[jt]sx?\` patterns (\`wrong-naming\`)
|
|
207
|
+
- Ignores known non-test files: setup files (\`setup.ts\`, \`test-setup.ts\`), mock files (\`mock-*\`, \`*-mock.ts\`), helpers, fixtures, utils, service mocks, and index re-exports
|
|
208
|
+
- Recursively scans \`__tests__/\` directories under \`packages/\`, \`services/\`, \`apps/\`, and \`tools/\`
|
|
209
|
+
- Skips \`node_modules\`, \`dist\`, \`build\`, \`coverage\`, \`.turbo\`, and \`.d.ts\` files
|
|
210
|
+
|
|
211
|
+
**Why it matters:** Incorrectly named test files are invisible to test runners, silently excluding them from the test suite and reducing effective coverage.
|
|
212
|
+
|
|
213
|
+
**Scope:** General best practice. Cross-file analysis via \`analyzeAll\` scanning \`__tests__/\` directories across the workspace.`,
|
|
214
|
+
tags: ['testing', 'consistency'],
|
|
215
|
+
fileTypes: ['ts', 'tsx'],
|
|
216
|
+
analyzeAll,
|
|
217
|
+
});
|
|
218
|
+
//# sourceMappingURL=test-file-naming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-file-naming.js","sourceRoot":"","sources":["../../../src/checks/testing/test-file-naming.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0HAA0H;AAE1H,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAA0C,MAAM,sBAAsB,CAAC;AAE3F;;GAEG;AACH,MAAM,mBAAmB,GAAG;IAC1B,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB,EAAE,kBAAkB;IACvC,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,sEAAsE;IAC5E,kBAAkB,EAAE,mBAAmB;IACvC,uBAAuB,EAAE,mBAAmB;IAC5C,uBAAuB,EAAE,wEAAwE;IACjG,yBAAyB,EAAE,qBAAqB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C,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE;IAClE,aAAa,EAAE,eAAe;IAE9B,UAAU,EAAE,QAAQ;IACpB,WAAW,EAAE,+EAA+E;IAC5F,eAAe,EAAE;;;;;;;;;;mIAUgH;IACjI,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IAExB,UAAU;CACX,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Ensures every source file in services has a corresponding test file
|
|
3
|
+
*
|
|
4
|
+
* This check validates that source files have matching test files.
|
|
5
|
+
* Supports @test-pending marker for files awaiting test implementation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check: testing/test-file-pairing
|
|
9
|
+
*
|
|
10
|
+
* Ensures every source file in services has a corresponding test file.
|
|
11
|
+
*/
|
|
12
|
+
export declare const testFilePairing: import("@opensip-cli/fitness").Check;
|
|
13
|
+
//# sourceMappingURL=test-file-pairing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-file-pairing.d.ts","sourceRoot":"","sources":["../../../src/checks/testing/test-file-pairing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8PH;;;;GAIG;AACH,eAAO,MAAM,eAAe,sCAuB1B,CAAC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Ensures every source file in services has a corresponding test file
|
|
3
|
+
*
|
|
4
|
+
* This check validates that source files have matching test files.
|
|
5
|
+
* Supports @test-pending marker for files awaiting test implementation.
|
|
6
|
+
*/
|
|
7
|
+
// @fitness-ignore-file fitness-check-standards -- Uses fs for directory listing/stat/existsSync operations, not file content reading
|
|
8
|
+
import * as fs from 'node:fs';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { logger } from '@opensip-cli/core';
|
|
11
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
12
|
+
/**
|
|
13
|
+
* Directories to skip during scanning
|
|
14
|
+
*/
|
|
15
|
+
const SKIP_DIRECTORIES = new Set([
|
|
16
|
+
'node_modules',
|
|
17
|
+
'__tests__',
|
|
18
|
+
'tests',
|
|
19
|
+
'types',
|
|
20
|
+
'interfaces',
|
|
21
|
+
'config',
|
|
22
|
+
'checks', // Fitness check definition files are declarative โ tested via fitness-check-coverage
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* Check if entry should be skipped
|
|
26
|
+
* @param {string} entry - The directory or file entry name to check
|
|
27
|
+
* @returns {boolean} True if the entry should be skipped, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
function shouldSkipEntry(entry) {
|
|
30
|
+
logger.debug({
|
|
31
|
+
evt: 'fitness.checks.test_file_pairing.should_skip_entry',
|
|
32
|
+
msg: 'Checking if entry should be skipped',
|
|
33
|
+
});
|
|
34
|
+
return entry.startsWith('.') || SKIP_DIRECTORIES.has(entry);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Config files that don't need tests
|
|
38
|
+
*/
|
|
39
|
+
const CONFIG_FILE_PATTERNS = [
|
|
40
|
+
/^vitest\.(config|setup|workspace)\.ts$/,
|
|
41
|
+
/^jest\.(config|setup)\.ts$/,
|
|
42
|
+
/^eslint\.config\.ts$/,
|
|
43
|
+
/^prettier\.config\.ts$/,
|
|
44
|
+
/^tailwind\.config\.ts$/,
|
|
45
|
+
/^tsconfig\..+\.ts$/,
|
|
46
|
+
/\.config\.ts$/,
|
|
47
|
+
/\.setup\.ts$/,
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* Check if file is a source file that needs tests
|
|
51
|
+
* @param {string} filename - The filename to check
|
|
52
|
+
* @param {string} [relativePath] - Optional relative path for additional context
|
|
53
|
+
* @returns {boolean} True if the file is a source file that needs tests, false otherwise
|
|
54
|
+
*/
|
|
55
|
+
/* v8 ignore start -- isSourceFile has many filename-pattern skip branches; covered indirectly */
|
|
56
|
+
function isSourceFile(filename, relativePath) {
|
|
57
|
+
logger.debug({
|
|
58
|
+
evt: 'fitness.checks.test_file_pairing.is_source_file',
|
|
59
|
+
msg: 'Checking if file is a source file that needs tests',
|
|
60
|
+
});
|
|
61
|
+
// Must be TS
|
|
62
|
+
if (!filename.endsWith('.ts') && !filename.endsWith('.tsx'))
|
|
63
|
+
return false;
|
|
64
|
+
// Skip declarations
|
|
65
|
+
if (filename.endsWith('.d.ts'))
|
|
66
|
+
return false;
|
|
67
|
+
// Skip existing test files
|
|
68
|
+
if (filename.includes('.test.') || filename.includes('.spec.'))
|
|
69
|
+
return false;
|
|
70
|
+
// Skip index files (often just exports)
|
|
71
|
+
if (filename === 'index.ts')
|
|
72
|
+
return false;
|
|
73
|
+
// Skip config files (vitest.config.ts, vitest.setup.ts, etc.)
|
|
74
|
+
if (CONFIG_FILE_PATTERNS.some((pattern) => pattern.test(filename)))
|
|
75
|
+
return false;
|
|
76
|
+
// Skip interface files (pure type definitions)
|
|
77
|
+
if (filename.includes('.interface.ts') || filename.includes('.interface.tsx'))
|
|
78
|
+
return false;
|
|
79
|
+
// Skip type definition files and data-only files
|
|
80
|
+
const typeOnlyPatterns = ['-types.ts', '-interfaces.ts', 'errors.ts', 'enums.ts', 'logger.ts'];
|
|
81
|
+
if (typeOnlyPatterns.some((pattern) => filename.endsWith(pattern)))
|
|
82
|
+
return false;
|
|
83
|
+
// Skip exact 'types.ts' (barrel type exports)
|
|
84
|
+
if (filename === 'types.ts' || filename === 'types.tsx')
|
|
85
|
+
return false;
|
|
86
|
+
// Skip pure data/schema/constants files
|
|
87
|
+
const dataOnlyPatterns = ['schema.ts', 'constants.ts', 'profiles.ts', 'error-messages.ts'];
|
|
88
|
+
if (dataOnlyPatterns.includes(filename))
|
|
89
|
+
return false;
|
|
90
|
+
// Skip files in types/ or interfaces/ directories
|
|
91
|
+
if (relativePath && (relativePath.includes('/types/') || relativePath.includes('/interfaces/')))
|
|
92
|
+
return false;
|
|
93
|
+
// Skip fitness check definition directories (declarative defineCheck files)
|
|
94
|
+
if (relativePath &&
|
|
95
|
+
relativePath.includes('/fitness/src/checks/') &&
|
|
96
|
+
!relativePath.includes('__tests__'))
|
|
97
|
+
return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
/* v8 ignore stop */
|
|
101
|
+
/**
|
|
102
|
+
* Check if a file has a test pair
|
|
103
|
+
* @param {string} dir - The directory containing the file
|
|
104
|
+
* @param {string} filename - The filename to check for test pairing
|
|
105
|
+
* @returns {boolean} True if a test pair exists, false otherwise
|
|
106
|
+
*/
|
|
107
|
+
function hasTestPair(dir, filename) {
|
|
108
|
+
logger.debug({
|
|
109
|
+
evt: 'fitness.checks.test_file_pairing.has_test_pair',
|
|
110
|
+
msg: 'Checking if file has a test pair',
|
|
111
|
+
});
|
|
112
|
+
// @fitness-ignore-next-line null-safety -- path.parse() always returns a valid ParsedPath object with a name property
|
|
113
|
+
const name = path.parse(filename).name;
|
|
114
|
+
const parentDir = path.dirname(dir);
|
|
115
|
+
const possibilities = [
|
|
116
|
+
// Adjacent test files
|
|
117
|
+
path.join(dir, `${name}.test.ts`),
|
|
118
|
+
path.join(dir, `${name}.spec.ts`),
|
|
119
|
+
path.join(dir, `${name}.test.tsx`),
|
|
120
|
+
path.join(dir, `${name}.spec.tsx`),
|
|
121
|
+
// __tests__ directory (flat)
|
|
122
|
+
path.join(dir, '__tests__', `${name}.test.ts`),
|
|
123
|
+
path.join(dir, '__tests__', `${name}.spec.ts`),
|
|
124
|
+
path.join(dir, '__tests__', `${name}.test.tsx`),
|
|
125
|
+
path.join(dir, '__tests__', `${name}.spec.tsx`),
|
|
126
|
+
// __tests__/unit directory
|
|
127
|
+
path.join(dir, '__tests__', 'unit', `${name}.test.ts`),
|
|
128
|
+
path.join(dir, '__tests__', 'unit', `${name}.spec.ts`),
|
|
129
|
+
path.join(dir, '__tests__', 'unit', `${name}.unit.test.ts`),
|
|
130
|
+
path.join(dir, '__tests__', 'unit', `${name}.unit.spec.ts`),
|
|
131
|
+
path.join(dir, '__tests__', 'unit', `${name}.test.tsx`),
|
|
132
|
+
path.join(dir, '__tests__', 'unit', `${name}.spec.tsx`),
|
|
133
|
+
path.join(dir, '__tests__', 'unit', `${name}.unit.test.tsx`),
|
|
134
|
+
path.join(dir, '__tests__', 'unit', `${name}.unit.spec.tsx`),
|
|
135
|
+
// Parent directory __tests__ (for files in core/ subdirectory)
|
|
136
|
+
path.join(parentDir, '__tests__', `${name}.test.ts`),
|
|
137
|
+
path.join(parentDir, '__tests__', `${name}.spec.ts`),
|
|
138
|
+
path.join(parentDir, '__tests__', 'unit', `${name}.test.ts`),
|
|
139
|
+
path.join(parentDir, '__tests__', 'unit', `${name}.spec.ts`),
|
|
140
|
+
path.join(parentDir, '__tests__', 'unit', `${name}.unit.test.ts`),
|
|
141
|
+
path.join(parentDir, '__tests__', 'unit', `${name}.unit.spec.ts`),
|
|
142
|
+
];
|
|
143
|
+
return possibilities.some((possiblePath) => fs.existsSync(possiblePath));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Check if a file has a @test-pending marker
|
|
147
|
+
* @returns {Promise<boolean>} True if the @test-pending marker is found, false otherwise
|
|
148
|
+
*/
|
|
149
|
+
async function hasTestPendingMarker(filePath, files) {
|
|
150
|
+
logger.debug({
|
|
151
|
+
evt: 'fitness.checks.test_file_pairing.has_test_pending_marker',
|
|
152
|
+
msg: 'Checking if file has a test-pending marker',
|
|
153
|
+
});
|
|
154
|
+
try {
|
|
155
|
+
const content = await files.read(filePath);
|
|
156
|
+
return content.slice(0, 500).includes('@test-pending');
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// @swallow-ok graceful degradation - return sentinel on failure
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Recursively scan directory for source files
|
|
165
|
+
*/
|
|
166
|
+
async function scanDirectory(dir, cwd, files) {
|
|
167
|
+
logger.debug({
|
|
168
|
+
evt: 'fitness.checks.test_file_pairing.scan_directory',
|
|
169
|
+
msg: 'Scanning directory for source files without test pairs',
|
|
170
|
+
});
|
|
171
|
+
const violations = [];
|
|
172
|
+
// @lazy-ok -- validations inside loop depend on loop iteration data, not pre-await guards
|
|
173
|
+
try {
|
|
174
|
+
const entries = fs.readdirSync(dir);
|
|
175
|
+
// Filter out entries that should be skipped
|
|
176
|
+
const relevantEntries = entries.filter((entry) => !shouldSkipEntry(entry));
|
|
177
|
+
for (const entry of relevantEntries) {
|
|
178
|
+
const fullPath = path.join(dir, entry);
|
|
179
|
+
const relativePath = path.relative(cwd, fullPath);
|
|
180
|
+
const stats = fs.statSync(fullPath);
|
|
181
|
+
if (stats.isDirectory()) {
|
|
182
|
+
const subViolations = await scanDirectory(fullPath, cwd, files);
|
|
183
|
+
violations.push(...subViolations);
|
|
184
|
+
}
|
|
185
|
+
else if (stats.isFile()) {
|
|
186
|
+
if (!isSourceFile(entry, relativePath))
|
|
187
|
+
continue;
|
|
188
|
+
if (await hasTestPendingMarker(fullPath, files))
|
|
189
|
+
continue;
|
|
190
|
+
if (hasTestPair(dir, entry))
|
|
191
|
+
continue;
|
|
192
|
+
// @fitness-ignore-next-line null-safety -- path.parse() always returns a valid ParsedPath object with a name property
|
|
193
|
+
const name = path.parse(entry).name;
|
|
194
|
+
const testDir = path.join(dir, '__tests__', 'unit');
|
|
195
|
+
const expectedTestFile = path.join(testDir, `${name}.unit.test.ts`);
|
|
196
|
+
const alternativeTestFile = path.join(testDir, `${name}.test.ts`);
|
|
197
|
+
violations.push({
|
|
198
|
+
line: 1,
|
|
199
|
+
message: `Missing test file for ${entry}. Expected ${name}.test.ts or ${name}.spec.ts`,
|
|
200
|
+
severity: 'error',
|
|
201
|
+
type: 'missing-test',
|
|
202
|
+
suggestion: `Create a test file: touch ${expectedTestFile} (or ${alternativeTestFile})`,
|
|
203
|
+
match: entry,
|
|
204
|
+
filePath: fullPath,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
// @swallow-ok Skip inaccessible directories
|
|
211
|
+
}
|
|
212
|
+
return violations;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Analyze all files for test pairing
|
|
216
|
+
*/
|
|
217
|
+
// @fitness-ignore-next-line concurrency-safety -- async keyword required by analyzeAll interface contract; synchronous analysis implementation
|
|
218
|
+
async function analyzeAll(files) {
|
|
219
|
+
logger.debug({
|
|
220
|
+
evt: 'fitness.checks.test_file_pairing.analyze_all',
|
|
221
|
+
msg: 'Analyzing all files for test pairing',
|
|
222
|
+
});
|
|
223
|
+
// Get the cwd from the first file path (all paths are absolute)
|
|
224
|
+
const firstPath = files.paths[0];
|
|
225
|
+
if (!firstPath) {
|
|
226
|
+
return [];
|
|
227
|
+
}
|
|
228
|
+
// Find the repo root by looking for packages directory
|
|
229
|
+
let cwd = path.dirname(firstPath);
|
|
230
|
+
while (cwd !== '/' && !fs.existsSync(path.join(cwd, 'packages'))) {
|
|
231
|
+
cwd = path.dirname(cwd);
|
|
232
|
+
}
|
|
233
|
+
const scanDirs = [path.join(cwd, 'packages'), path.join(cwd, 'apps'), path.join(cwd, 'services')];
|
|
234
|
+
const allViolations = [];
|
|
235
|
+
for (const dir of scanDirs) {
|
|
236
|
+
if (!fs.existsSync(dir))
|
|
237
|
+
continue;
|
|
238
|
+
// @fitness-ignore-next-line performance-anti-patterns -- sequential directory scanning required: each scan depends on shared file system state
|
|
239
|
+
const dirViolations = await scanDirectory(dir, cwd, files);
|
|
240
|
+
for (const violation of dirViolations) {
|
|
241
|
+
allViolations.push(violation);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return allViolations;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Check: testing/test-file-pairing
|
|
248
|
+
*
|
|
249
|
+
* Ensures every source file in services has a corresponding test file.
|
|
250
|
+
*/
|
|
251
|
+
export const testFilePairing = defineCheck({
|
|
252
|
+
id: '6f807024-f5c3-4364-a1f3-ccd39d439df2',
|
|
253
|
+
slug: 'test-file-pairing',
|
|
254
|
+
scope: { languages: ['typescript'], concerns: ['backend', 'server'] },
|
|
255
|
+
contentFilter: 'strip-strings',
|
|
256
|
+
confidence: 'high',
|
|
257
|
+
description: 'Ensures every source file has a corresponding test file',
|
|
258
|
+
longDescription: `**Purpose:** Ensures every TypeScript source file in \`packages/\`, \`apps/\`, and \`services/\` has a corresponding test file, enforcing test coverage completeness.
|
|
259
|
+
|
|
260
|
+
**Detects:**
|
|
261
|
+
- Source \`.ts\`/\`.tsx\` files missing a paired test file (\`missing-test\`)
|
|
262
|
+
- Searches for test pairs in multiple locations: adjacent files, \`__tests__/\`, \`__tests__/unit/\`, and parent \`__tests__/\` directories
|
|
263
|
+
- Accepts \`.test.ts\`, \`.spec.ts\`, \`.unit.test.ts\`, and \`.unit.spec.ts\` suffixes
|
|
264
|
+
- Respects \`@test-pending\` marker in the first 500 characters of a file to suppress the violation
|
|
265
|
+
- Excludes index files, \`.d.ts\`, config files, interface/type-only files, enums, errors, and logger files
|
|
266
|
+
|
|
267
|
+
**Why it matters:** Unpaired source files represent gaps in test coverage that can lead to undetected regressions.
|
|
268
|
+
|
|
269
|
+
**Scope:** Codebase-specific convention. Cross-file analysis via \`analyzeAll\` recursively scanning \`packages/\`, \`apps/\`, and \`services/\`.`,
|
|
270
|
+
tags: ['testing', 'coverage'],
|
|
271
|
+
fileTypes: ['ts'],
|
|
272
|
+
analyzeAll,
|
|
273
|
+
});
|
|
274
|
+
//# sourceMappingURL=test-file-pairing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-file-pairing.js","sourceRoot":"","sources":["../../../src/checks/testing/test-file-pairing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qIAAqI;AACrI,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAA0C,MAAM,sBAAsB,CAAC;AAE3F;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,cAAc;IACd,WAAW;IACX,OAAO;IACP,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ,EAAE,qFAAqF;CAChG,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,CAAC,KAAK,CAAC;QACX,GAAG,EAAE,oDAAoD;QACzD,GAAG,EAAE,qCAAqC;KAC3C,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,oBAAoB,GAAG;IAC3B,wCAAwC;IACxC,4BAA4B;IAC5B,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,oBAAoB;IACpB,eAAe;IACf,cAAc;CACf,CAAC;AAEF;;;;;GAKG;AACH,iGAAiG;AACjG,SAAS,YAAY,CAAC,QAAgB,EAAE,YAAqB;IAC3D,MAAM,CAAC,KAAK,CAAC;QACX,GAAG,EAAE,iDAAiD;QACtD,GAAG,EAAE,oDAAoD;KAC1D,CAAC,CAAC;IACH,aAAa;IACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAA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,aAAa,EAAE,CAAC;YACtC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACzC,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE;IACrE,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,yDAAyD;IACtE,eAAe,EAAE;;;;;;;;;;;kJAW+H;IAChJ,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7B,SAAS,EAAE,CAAC,IAAI,CAAC;IAEjB,UAAU;CACX,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Display entries for cross-language architecture and documentation checks
|
|
3
|
+
*/
|
|
4
|
+
import type { CheckDisplayEntry } from './types.js';
|
|
5
|
+
/** Architecture check display entries (UNIVERSAL only) */
|
|
6
|
+
export declare const ARCHITECTURE_DISPLAY: Readonly<Record<string, CheckDisplayEntry>>;
|
|
7
|
+
/** Documentation check display entries (UNIVERSAL only) */
|
|
8
|
+
export declare const DOCUMENTATION_DISPLAY: Readonly<Record<string, CheckDisplayEntry>>;
|
|
9
|
+
//# sourceMappingURL=architecture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,6CAkB/B,CAAC;AAEH,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,6CAGhC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Display entries for cross-language architecture and documentation checks
|
|
3
|
+
*/
|
|
4
|
+
/** Architecture check display entries (UNIVERSAL only) */
|
|
5
|
+
export const ARCHITECTURE_DISPLAY = Object.freeze({
|
|
6
|
+
'docker-best-practices': ['๐ณ', 'Docker Best Practices'],
|
|
7
|
+
'docker-ignore-validation': ['๐ณ', 'Docker Ignore Validation'],
|
|
8
|
+
'docker-version-sync': ['๐ณ', 'Docker Version Sync'],
|
|
9
|
+
'empty-package-detection': ['๐ฆ', 'Empty Package Detection'],
|
|
10
|
+
'env-var-validation': ['๐ง', 'Env Var Validation'],
|
|
11
|
+
'file-length-limit': ['๐', 'File Length Limit'],
|
|
12
|
+
'heavy-import-detection': ['๐ฆ', 'Heavy Import Detection'],
|
|
13
|
+
'interface-implementation-consistency': ['๐', 'Interface Implementation Consistency'],
|
|
14
|
+
'no-custom-event-emitter': ['๐จ', 'No Custom Event Emitter'],
|
|
15
|
+
'no-duplicate-packages': ['๐ฆ', 'No Duplicate Packages'],
|
|
16
|
+
'no-kebab-option-indexing': ['๐ซ', 'No Kebab Option Indexing'],
|
|
17
|
+
'node-version-consistency': ['๐ฆ', 'Node Version Consistency'],
|
|
18
|
+
'project-readme-existence': ['๐', 'Project README Existence'],
|
|
19
|
+
'stale-build-artifacts': ['๐๏ธ', 'Stale Build Artifacts'],
|
|
20
|
+
'tool-has-manifest': ['๐ชช', 'Tool Has Manifest'],
|
|
21
|
+
'vitest-config-extends-base': ['๐งช', 'Vitest Config Extends Base'],
|
|
22
|
+
'vitest-config-required-with-tests': ['๐งช', 'Vitest Config Required With Tests'],
|
|
23
|
+
});
|
|
24
|
+
/** Documentation check display entries (UNIVERSAL only) */
|
|
25
|
+
export const DOCUMENTATION_DISPLAY = Object.freeze({
|
|
26
|
+
'directive-audit': ['๐', 'Directive Audit'],
|
|
27
|
+
'public-api-jsdoc': ['๐', 'Public API JSDoc Coverage'],
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=architecture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../src/display/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAoC;IACnF,uBAAuB,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACxD,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,qBAAqB,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACpD,yBAAyB,EAAE,CAAC,IAAI,EAAE,yBAAyB,CAAC;IAC5D,oBAAoB,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAClD,mBAAmB,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAChD,wBAAwB,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;IAC1D,sCAAsC,EAAE,CAAC,IAAI,EAAE,sCAAsC,CAAC;IACtF,yBAAyB,EAAE,CAAC,IAAI,EAAE,yBAAyB,CAAC;IAC5D,uBAAuB,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACxD,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,0BAA0B,EAAE,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC9D,uBAAuB,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACzD,mBAAmB,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAChD,4BAA4B,EAAE,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAClE,mCAAmC,EAAE,CAAC,IAAI,EAAE,mCAAmC,CAAC;CACjF,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAoC;IACpF,iBAAiB,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAC5C,kBAAkB,EAAE,CAAC,IAAI,EAAE,2BAA2B,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Display configuration for cross-language fitness checks
|
|
3
|
+
*
|
|
4
|
+
* Maps check slugs to display entries (icon + display name) for CLI and dashboard output.
|
|
5
|
+
* Falls back to kebab-to-title-case conversion for unknown slugs.
|
|
6
|
+
*
|
|
7
|
+
* The lookup logic itself lives in @opensip-cli/fitness/check-utils; this
|
|
8
|
+
* file owns only the per-pack CHECK_DISPLAY map and binds the shared helpers
|
|
9
|
+
* to it.
|
|
10
|
+
*/
|
|
11
|
+
import type { CheckDisplayEntry } from './types.js';
|
|
12
|
+
/** Combined check display configuration */
|
|
13
|
+
export declare const CHECK_DISPLAY: Readonly<Record<string, CheckDisplayEntry>>;
|
|
14
|
+
/**
|
|
15
|
+
* Slug-only display lookups bound to this pack's CHECK_DISPLAY map. The lookup
|
|
16
|
+
* logic lives in @opensip-cli/fitness; this file owns only the data.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getCheckIcon: (checkSlug: string) => string, getCheckDisplayName: (checkSlug: string) => string;
|
|
19
|
+
export { type CheckDisplayEntry } from './types.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,2CAA2C;AAC3C,eAAO,MAAM,aAAa,6CAOxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAQ,YAAY,iCAAE,mBAAmB,+BAAsC,CAAC;AAEvF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Display configuration for cross-language fitness checks
|
|
3
|
+
*
|
|
4
|
+
* Maps check slugs to display entries (icon + display name) for CLI and dashboard output.
|
|
5
|
+
* Falls back to kebab-to-title-case conversion for unknown slugs.
|
|
6
|
+
*
|
|
7
|
+
* The lookup logic itself lives in @opensip-cli/fitness/check-utils; this
|
|
8
|
+
* file owns only the per-pack CHECK_DISPLAY map and binds the shared helpers
|
|
9
|
+
* to it.
|
|
10
|
+
*/
|
|
11
|
+
import { makeDisplayHelpers } from '@opensip-cli/fitness';
|
|
12
|
+
import { ARCHITECTURE_DISPLAY, DOCUMENTATION_DISPLAY } from './architecture.js';
|
|
13
|
+
import { QUALITY_DISPLAY } from './quality.js';
|
|
14
|
+
import { RESILIENCE_DISPLAY } from './resilience.js';
|
|
15
|
+
import { SECURITY_DISPLAY, TESTING_DISPLAY } from './security-testing.js';
|
|
16
|
+
/** Combined check display configuration */
|
|
17
|
+
export const CHECK_DISPLAY = Object.freeze({
|
|
18
|
+
...ARCHITECTURE_DISPLAY,
|
|
19
|
+
...DOCUMENTATION_DISPLAY,
|
|
20
|
+
...QUALITY_DISPLAY,
|
|
21
|
+
...RESILIENCE_DISPLAY,
|
|
22
|
+
...SECURITY_DISPLAY,
|
|
23
|
+
...TESTING_DISPLAY,
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Slug-only display lookups bound to this pack's CHECK_DISPLAY map. The lookup
|
|
27
|
+
* logic lives in @opensip-cli/fitness; this file owns only the data.
|
|
28
|
+
*/
|
|
29
|
+
export const { getCheckIcon, getCheckDisplayName } = makeDisplayHelpers(CHECK_DISPLAY);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI1E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAoC;IAC5E,GAAG,oBAAoB;IACvB,GAAG,qBAAqB;IACxB,GAAG,eAAe;IAClB,GAAG,kBAAkB;IACrB,GAAG,gBAAgB;IACnB,GAAG,eAAe;CACnB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC"}
|