driftdetect-detectors 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/dist/accessibility/alt-text.d.ts +63 -0
- package/dist/accessibility/alt-text.d.ts.map +1 -0
- package/dist/accessibility/alt-text.js +100 -0
- package/dist/accessibility/alt-text.js.map +1 -0
- package/dist/accessibility/aria-roles.d.ts +65 -0
- package/dist/accessibility/aria-roles.d.ts.map +1 -0
- package/dist/accessibility/aria-roles.js +87 -0
- package/dist/accessibility/aria-roles.js.map +1 -0
- package/dist/accessibility/focus-management.d.ts +62 -0
- package/dist/accessibility/focus-management.d.ts.map +1 -0
- package/dist/accessibility/focus-management.js +88 -0
- package/dist/accessibility/focus-management.js.map +1 -0
- package/dist/accessibility/heading-hierarchy.d.ts +66 -0
- package/dist/accessibility/heading-hierarchy.d.ts.map +1 -0
- package/dist/accessibility/heading-hierarchy.js +94 -0
- package/dist/accessibility/heading-hierarchy.js.map +1 -0
- package/dist/accessibility/index.d.ts +25 -0
- package/dist/accessibility/index.d.ts.map +1 -0
- package/dist/accessibility/index.js +21 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/accessibility/keyboard-nav.d.ts +63 -0
- package/dist/accessibility/keyboard-nav.d.ts.map +1 -0
- package/dist/accessibility/keyboard-nav.js +86 -0
- package/dist/accessibility/keyboard-nav.js.map +1 -0
- package/dist/accessibility/semantic-html.d.ts +76 -0
- package/dist/accessibility/semantic-html.d.ts.map +1 -0
- package/dist/accessibility/semantic-html.js +204 -0
- package/dist/accessibility/semantic-html.js.map +1 -0
- package/dist/api/client-patterns.d.ts +121 -0
- package/dist/api/client-patterns.d.ts.map +1 -0
- package/dist/api/client-patterns.js +478 -0
- package/dist/api/client-patterns.js.map +1 -0
- package/dist/api/error-format.d.ts +140 -0
- package/dist/api/error-format.d.ts.map +1 -0
- package/dist/api/error-format.js +614 -0
- package/dist/api/error-format.js.map +1 -0
- package/dist/api/http-methods.d.ts +255 -0
- package/dist/api/http-methods.d.ts.map +1 -0
- package/dist/api/http-methods.js +890 -0
- package/dist/api/http-methods.js.map +1 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +37 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pagination.d.ts +133 -0
- package/dist/api/pagination.d.ts.map +1 -0
- package/dist/api/pagination.js +521 -0
- package/dist/api/pagination.js.map +1 -0
- package/dist/api/response-envelope.d.ts +261 -0
- package/dist/api/response-envelope.d.ts.map +1 -0
- package/dist/api/response-envelope.js +1050 -0
- package/dist/api/response-envelope.js.map +1 -0
- package/dist/api/retry-patterns.d.ts +117 -0
- package/dist/api/retry-patterns.d.ts.map +1 -0
- package/dist/api/retry-patterns.js +480 -0
- package/dist/api/retry-patterns.js.map +1 -0
- package/dist/api/route-structure.d.ts +128 -0
- package/dist/api/route-structure.d.ts.map +1 -0
- package/dist/api/route-structure.js +738 -0
- package/dist/api/route-structure.js.map +1 -0
- package/dist/auth/audit-logging.d.ts +80 -0
- package/dist/auth/audit-logging.d.ts.map +1 -0
- package/dist/auth/audit-logging.js +370 -0
- package/dist/auth/audit-logging.js.map +1 -0
- package/dist/auth/index.d.ts +33 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +49 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/middleware-usage.d.ts +65 -0
- package/dist/auth/middleware-usage.d.ts.map +1 -0
- package/dist/auth/middleware-usage.js +192 -0
- package/dist/auth/middleware-usage.js.map +1 -0
- package/dist/auth/permission-checks.d.ts +60 -0
- package/dist/auth/permission-checks.d.ts.map +1 -0
- package/dist/auth/permission-checks.js +159 -0
- package/dist/auth/permission-checks.js.map +1 -0
- package/dist/auth/rbac-patterns.d.ts +68 -0
- package/dist/auth/rbac-patterns.d.ts.map +1 -0
- package/dist/auth/rbac-patterns.js +143 -0
- package/dist/auth/rbac-patterns.js.map +1 -0
- package/dist/auth/resource-ownership.d.ts +77 -0
- package/dist/auth/resource-ownership.d.ts.map +1 -0
- package/dist/auth/resource-ownership.js +324 -0
- package/dist/auth/resource-ownership.js.map +1 -0
- package/dist/auth/token-handling.d.ts +64 -0
- package/dist/auth/token-handling.d.ts.map +1 -0
- package/dist/auth/token-handling.js +151 -0
- package/dist/auth/token-handling.js.map +1 -0
- package/dist/base/ast-detector.d.ts +421 -0
- package/dist/base/ast-detector.d.ts.map +1 -0
- package/dist/base/ast-detector.js +699 -0
- package/dist/base/ast-detector.js.map +1 -0
- package/dist/base/base-detector.d.ts +366 -0
- package/dist/base/base-detector.d.ts.map +1 -0
- package/dist/base/base-detector.js +170 -0
- package/dist/base/base-detector.js.map +1 -0
- package/dist/base/index.d.ts +12 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +17 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/regex-detector.d.ts +421 -0
- package/dist/base/regex-detector.d.ts.map +1 -0
- package/dist/base/regex-detector.js +537 -0
- package/dist/base/regex-detector.js.map +1 -0
- package/dist/base/structural-detector.d.ts +424 -0
- package/dist/base/structural-detector.d.ts.map +1 -0
- package/dist/base/structural-detector.js +731 -0
- package/dist/base/structural-detector.js.map +1 -0
- package/dist/base/types.d.ts +53 -0
- package/dist/base/types.d.ts.map +1 -0
- package/dist/base/types.js +5 -0
- package/dist/base/types.js.map +1 -0
- package/dist/components/component-structure.d.ts +163 -0
- package/dist/components/component-structure.d.ts.map +1 -0
- package/dist/components/component-structure.js +500 -0
- package/dist/components/component-structure.js.map +1 -0
- package/dist/components/composition.d.ts +287 -0
- package/dist/components/composition.d.ts.map +1 -0
- package/dist/components/composition.js +1123 -0
- package/dist/components/composition.js.map +1 -0
- package/dist/components/duplicate-detection.d.ts +251 -0
- package/dist/components/duplicate-detection.d.ts.map +1 -0
- package/dist/components/duplicate-detection.js +804 -0
- package/dist/components/duplicate-detection.js.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/near-duplicate.d.ts +402 -0
- package/dist/components/near-duplicate.d.ts.map +1 -0
- package/dist/components/near-duplicate.js +1090 -0
- package/dist/components/near-duplicate.js.map +1 -0
- package/dist/components/props-patterns.d.ts +194 -0
- package/dist/components/props-patterns.d.ts.map +1 -0
- package/dist/components/props-patterns.js +795 -0
- package/dist/components/props-patterns.js.map +1 -0
- package/dist/components/ref-forwarding.d.ts +250 -0
- package/dist/components/ref-forwarding.d.ts.map +1 -0
- package/dist/components/ref-forwarding.js +832 -0
- package/dist/components/ref-forwarding.js.map +1 -0
- package/dist/components/state-patterns.d.ts +291 -0
- package/dist/components/state-patterns.d.ts.map +1 -0
- package/dist/components/state-patterns.js +970 -0
- package/dist/components/state-patterns.js.map +1 -0
- package/dist/config/config-validation.d.ts +74 -0
- package/dist/config/config-validation.d.ts.map +1 -0
- package/dist/config/config-validation.js +446 -0
- package/dist/config/config-validation.js.map +1 -0
- package/dist/config/default-values.d.ts +72 -0
- package/dist/config/default-values.d.ts.map +1 -0
- package/dist/config/default-values.js +386 -0
- package/dist/config/default-values.js.map +1 -0
- package/dist/config/env-naming.d.ts +73 -0
- package/dist/config/env-naming.d.ts.map +1 -0
- package/dist/config/env-naming.js +429 -0
- package/dist/config/env-naming.js.map +1 -0
- package/dist/config/environment-detection.d.ts +72 -0
- package/dist/config/environment-detection.d.ts.map +1 -0
- package/dist/config/environment-detection.js +400 -0
- package/dist/config/environment-detection.js.map +1 -0
- package/dist/config/feature-flags.d.ts +72 -0
- package/dist/config/feature-flags.d.ts.map +1 -0
- package/dist/config/feature-flags.js +384 -0
- package/dist/config/feature-flags.js.map +1 -0
- package/dist/config/index.d.ts +27 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +43 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/required-optional.d.ts +71 -0
- package/dist/config/required-optional.d.ts.map +1 -0
- package/dist/config/required-optional.js +344 -0
- package/dist/config/required-optional.js.map +1 -0
- package/dist/data-access/connection-pooling.d.ts +63 -0
- package/dist/data-access/connection-pooling.d.ts.map +1 -0
- package/dist/data-access/connection-pooling.js +297 -0
- package/dist/data-access/connection-pooling.js.map +1 -0
- package/dist/data-access/dto-patterns.d.ts +64 -0
- package/dist/data-access/dto-patterns.d.ts.map +1 -0
- package/dist/data-access/dto-patterns.js +291 -0
- package/dist/data-access/dto-patterns.js.map +1 -0
- package/dist/data-access/index.d.ts +31 -0
- package/dist/data-access/index.d.ts.map +1 -0
- package/dist/data-access/index.js +49 -0
- package/dist/data-access/index.js.map +1 -0
- package/dist/data-access/n-plus-one.d.ts +60 -0
- package/dist/data-access/n-plus-one.d.ts.map +1 -0
- package/dist/data-access/n-plus-one.js +264 -0
- package/dist/data-access/n-plus-one.js.map +1 -0
- package/dist/data-access/query-patterns.d.ts +64 -0
- package/dist/data-access/query-patterns.d.ts.map +1 -0
- package/dist/data-access/query-patterns.js +314 -0
- package/dist/data-access/query-patterns.js.map +1 -0
- package/dist/data-access/repository-pattern.d.ts +62 -0
- package/dist/data-access/repository-pattern.d.ts.map +1 -0
- package/dist/data-access/repository-pattern.js +257 -0
- package/dist/data-access/repository-pattern.js.map +1 -0
- package/dist/data-access/transaction-patterns.d.ts +61 -0
- package/dist/data-access/transaction-patterns.d.ts.map +1 -0
- package/dist/data-access/transaction-patterns.js +277 -0
- package/dist/data-access/transaction-patterns.js.map +1 -0
- package/dist/data-access/validation-patterns.d.ts +62 -0
- package/dist/data-access/validation-patterns.d.ts.map +1 -0
- package/dist/data-access/validation-patterns.js +301 -0
- package/dist/data-access/validation-patterns.js.map +1 -0
- package/dist/documentation/deprecation.d.ts +62 -0
- package/dist/documentation/deprecation.d.ts.map +1 -0
- package/dist/documentation/deprecation.js +83 -0
- package/dist/documentation/deprecation.js.map +1 -0
- package/dist/documentation/example-code.d.ts +64 -0
- package/dist/documentation/example-code.d.ts.map +1 -0
- package/dist/documentation/example-code.js +79 -0
- package/dist/documentation/example-code.js.map +1 -0
- package/dist/documentation/index.d.ts +22 -0
- package/dist/documentation/index.d.ts.map +1 -0
- package/dist/documentation/index.js +19 -0
- package/dist/documentation/index.js.map +1 -0
- package/dist/documentation/jsdoc-patterns.d.ts +72 -0
- package/dist/documentation/jsdoc-patterns.d.ts.map +1 -0
- package/dist/documentation/jsdoc-patterns.js +92 -0
- package/dist/documentation/jsdoc-patterns.js.map +1 -0
- package/dist/documentation/readme-structure.d.ts +67 -0
- package/dist/documentation/readme-structure.d.ts.map +1 -0
- package/dist/documentation/readme-structure.js +76 -0
- package/dist/documentation/readme-structure.js.map +1 -0
- package/dist/documentation/todo-patterns.d.ts +67 -0
- package/dist/documentation/todo-patterns.d.ts.map +1 -0
- package/dist/documentation/todo-patterns.js +73 -0
- package/dist/documentation/todo-patterns.js.map +1 -0
- package/dist/errors/async-errors.d.ts +72 -0
- package/dist/errors/async-errors.d.ts.map +1 -0
- package/dist/errors/async-errors.js +214 -0
- package/dist/errors/async-errors.js.map +1 -0
- package/dist/errors/circuit-breaker.d.ts +53 -0
- package/dist/errors/circuit-breaker.d.ts.map +1 -0
- package/dist/errors/circuit-breaker.js +241 -0
- package/dist/errors/circuit-breaker.js.map +1 -0
- package/dist/errors/error-codes.d.ts +73 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +211 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/error-logging.d.ts +73 -0
- package/dist/errors/error-logging.d.ts.map +1 -0
- package/dist/errors/error-logging.js +256 -0
- package/dist/errors/error-logging.js.map +1 -0
- package/dist/errors/error-propagation.d.ts +73 -0
- package/dist/errors/error-propagation.d.ts.map +1 -0
- package/dist/errors/error-propagation.js +244 -0
- package/dist/errors/error-propagation.js.map +1 -0
- package/dist/errors/exception-hierarchy.d.ts +75 -0
- package/dist/errors/exception-hierarchy.d.ts.map +1 -0
- package/dist/errors/exception-hierarchy.js +259 -0
- package/dist/errors/exception-hierarchy.js.map +1 -0
- package/dist/errors/index.d.ts +31 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +49 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/try-catch-placement.d.ts +73 -0
- package/dist/errors/try-catch-placement.d.ts.map +1 -0
- package/dist/errors/try-catch-placement.js +214 -0
- package/dist/errors/try-catch-placement.js.map +1 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/context-fields.d.ts +48 -0
- package/dist/logging/context-fields.d.ts.map +1 -0
- package/dist/logging/context-fields.js +160 -0
- package/dist/logging/context-fields.js.map +1 -0
- package/dist/logging/correlation-ids.d.ts +44 -0
- package/dist/logging/correlation-ids.d.ts.map +1 -0
- package/dist/logging/correlation-ids.js +144 -0
- package/dist/logging/correlation-ids.js.map +1 -0
- package/dist/logging/health-checks.d.ts +45 -0
- package/dist/logging/health-checks.d.ts.map +1 -0
- package/dist/logging/health-checks.js +165 -0
- package/dist/logging/health-checks.js.map +1 -0
- package/dist/logging/index.d.ts +31 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +49 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/log-levels.d.ts +46 -0
- package/dist/logging/log-levels.d.ts.map +1 -0
- package/dist/logging/log-levels.js +178 -0
- package/dist/logging/log-levels.js.map +1 -0
- package/dist/logging/metric-naming.d.ts +46 -0
- package/dist/logging/metric-naming.d.ts.map +1 -0
- package/dist/logging/metric-naming.js +157 -0
- package/dist/logging/metric-naming.js.map +1 -0
- package/dist/logging/pii-redaction.d.ts +44 -0
- package/dist/logging/pii-redaction.d.ts.map +1 -0
- package/dist/logging/pii-redaction.js +166 -0
- package/dist/logging/pii-redaction.js.map +1 -0
- package/dist/logging/structured-format.d.ts +53 -0
- package/dist/logging/structured-format.d.ts.map +1 -0
- package/dist/logging/structured-format.js +235 -0
- package/dist/logging/structured-format.js.map +1 -0
- package/dist/performance/bundle-size.d.ts +79 -0
- package/dist/performance/bundle-size.d.ts.map +1 -0
- package/dist/performance/bundle-size.js +276 -0
- package/dist/performance/bundle-size.js.map +1 -0
- package/dist/performance/caching-patterns.d.ts +78 -0
- package/dist/performance/caching-patterns.d.ts.map +1 -0
- package/dist/performance/caching-patterns.js +257 -0
- package/dist/performance/caching-patterns.js.map +1 -0
- package/dist/performance/code-splitting.d.ts +86 -0
- package/dist/performance/code-splitting.d.ts.map +1 -0
- package/dist/performance/code-splitting.js +447 -0
- package/dist/performance/code-splitting.js.map +1 -0
- package/dist/performance/debounce-throttle.d.ts +75 -0
- package/dist/performance/debounce-throttle.d.ts.map +1 -0
- package/dist/performance/debounce-throttle.js +232 -0
- package/dist/performance/debounce-throttle.js.map +1 -0
- package/dist/performance/index.d.ts +28 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +39 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/lazy-loading.d.ts +75 -0
- package/dist/performance/lazy-loading.d.ts.map +1 -0
- package/dist/performance/lazy-loading.js +233 -0
- package/dist/performance/lazy-loading.js.map +1 -0
- package/dist/performance/memoization.d.ts +75 -0
- package/dist/performance/memoization.d.ts.map +1 -0
- package/dist/performance/memoization.js +251 -0
- package/dist/performance/memoization.js.map +1 -0
- package/dist/registry/detector-registry.d.ts +266 -0
- package/dist/registry/detector-registry.d.ts.map +1 -0
- package/dist/registry/detector-registry.js +526 -0
- package/dist/registry/detector-registry.js.map +1 -0
- package/dist/registry/index.d.ts +10 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/loader.d.ts +232 -0
- package/dist/registry/loader.d.ts.map +1 -0
- package/dist/registry/loader.js +419 -0
- package/dist/registry/loader.js.map +1 -0
- package/dist/registry/types.d.ts +111 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +19 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/security/csp-headers.d.ts +78 -0
- package/dist/security/csp-headers.d.ts.map +1 -0
- package/dist/security/csp-headers.js +401 -0
- package/dist/security/csp-headers.js.map +1 -0
- package/dist/security/csrf-protection.d.ts +72 -0
- package/dist/security/csrf-protection.d.ts.map +1 -0
- package/dist/security/csrf-protection.js +344 -0
- package/dist/security/csrf-protection.js.map +1 -0
- package/dist/security/index.d.ts +30 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +48 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/input-sanitization.d.ts +74 -0
- package/dist/security/input-sanitization.d.ts.map +1 -0
- package/dist/security/input-sanitization.js +373 -0
- package/dist/security/input-sanitization.js.map +1 -0
- package/dist/security/rate-limiting.d.ts +81 -0
- package/dist/security/rate-limiting.d.ts.map +1 -0
- package/dist/security/rate-limiting.js +535 -0
- package/dist/security/rate-limiting.js.map +1 -0
- package/dist/security/secret-management.d.ts +83 -0
- package/dist/security/secret-management.d.ts.map +1 -0
- package/dist/security/secret-management.js +547 -0
- package/dist/security/secret-management.js.map +1 -0
- package/dist/security/sql-injection.d.ts +76 -0
- package/dist/security/sql-injection.d.ts.map +1 -0
- package/dist/security/sql-injection.js +383 -0
- package/dist/security/sql-injection.js.map +1 -0
- package/dist/security/xss-prevention.d.ts +80 -0
- package/dist/security/xss-prevention.d.ts.map +1 -0
- package/dist/security/xss-prevention.js +416 -0
- package/dist/security/xss-prevention.js.map +1 -0
- package/dist/structural/barrel-exports.d.ts +178 -0
- package/dist/structural/barrel-exports.d.ts.map +1 -0
- package/dist/structural/barrel-exports.js +553 -0
- package/dist/structural/barrel-exports.js.map +1 -0
- package/dist/structural/circular-deps.d.ts +140 -0
- package/dist/structural/circular-deps.d.ts.map +1 -0
- package/dist/structural/circular-deps.js +422 -0
- package/dist/structural/circular-deps.js.map +1 -0
- package/dist/structural/co-location.d.ts +202 -0
- package/dist/structural/co-location.d.ts.map +1 -0
- package/dist/structural/co-location.js +640 -0
- package/dist/structural/co-location.js.map +1 -0
- package/dist/structural/directory-structure.d.ts +151 -0
- package/dist/structural/directory-structure.d.ts.map +1 -0
- package/dist/structural/directory-structure.js +457 -0
- package/dist/structural/directory-structure.js.map +1 -0
- package/dist/structural/file-naming.d.ts +61 -0
- package/dist/structural/file-naming.d.ts.map +1 -0
- package/dist/structural/file-naming.js +231 -0
- package/dist/structural/file-naming.js.map +1 -0
- package/dist/structural/import-ordering.d.ts +212 -0
- package/dist/structural/import-ordering.d.ts.map +1 -0
- package/dist/structural/import-ordering.js +821 -0
- package/dist/structural/import-ordering.js.map +1 -0
- package/dist/structural/index.d.ts +23 -0
- package/dist/structural/index.d.ts.map +1 -0
- package/dist/structural/index.js +26 -0
- package/dist/structural/index.js.map +1 -0
- package/dist/structural/module-boundaries.d.ts +164 -0
- package/dist/structural/module-boundaries.d.ts.map +1 -0
- package/dist/structural/module-boundaries.js +616 -0
- package/dist/structural/module-boundaries.js.map +1 -0
- package/dist/structural/package-boundaries.d.ts +182 -0
- package/dist/structural/package-boundaries.d.ts.map +1 -0
- package/dist/structural/package-boundaries.js +602 -0
- package/dist/structural/package-boundaries.js.map +1 -0
- package/dist/styling/class-naming.d.ts +263 -0
- package/dist/styling/class-naming.d.ts.map +1 -0
- package/dist/styling/class-naming.js +892 -0
- package/dist/styling/class-naming.js.map +1 -0
- package/dist/styling/color-usage.d.ts +213 -0
- package/dist/styling/color-usage.d.ts.map +1 -0
- package/dist/styling/color-usage.js +732 -0
- package/dist/styling/color-usage.js.map +1 -0
- package/dist/styling/design-tokens.d.ts +212 -0
- package/dist/styling/design-tokens.d.ts.map +1 -0
- package/dist/styling/design-tokens.js +748 -0
- package/dist/styling/design-tokens.js.map +1 -0
- package/dist/styling/index.d.ts +16 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +56 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/responsive.d.ts +304 -0
- package/dist/styling/responsive.d.ts.map +1 -0
- package/dist/styling/responsive.js +888 -0
- package/dist/styling/responsive.js.map +1 -0
- package/dist/styling/spacing-scale.d.ts +248 -0
- package/dist/styling/spacing-scale.d.ts.map +1 -0
- package/dist/styling/spacing-scale.js +865 -0
- package/dist/styling/spacing-scale.js.map +1 -0
- package/dist/styling/tailwind-patterns.d.ts +305 -0
- package/dist/styling/tailwind-patterns.d.ts.map +1 -0
- package/dist/styling/tailwind-patterns.js +1181 -0
- package/dist/styling/tailwind-patterns.js.map +1 -0
- package/dist/styling/typography.d.ts +281 -0
- package/dist/styling/typography.d.ts.map +1 -0
- package/dist/styling/typography.js +1004 -0
- package/dist/styling/typography.js.map +1 -0
- package/dist/styling/z-index-scale.d.ts +270 -0
- package/dist/styling/z-index-scale.d.ts.map +1 -0
- package/dist/styling/z-index-scale.js +714 -0
- package/dist/styling/z-index-scale.js.map +1 -0
- package/dist/testing/co-location.d.ts +42 -0
- package/dist/testing/co-location.d.ts.map +1 -0
- package/dist/testing/co-location.js +134 -0
- package/dist/testing/co-location.js.map +1 -0
- package/dist/testing/describe-naming.d.ts +47 -0
- package/dist/testing/describe-naming.d.ts.map +1 -0
- package/dist/testing/describe-naming.js +150 -0
- package/dist/testing/describe-naming.js.map +1 -0
- package/dist/testing/file-naming.d.ts +44 -0
- package/dist/testing/file-naming.d.ts.map +1 -0
- package/dist/testing/file-naming.js +131 -0
- package/dist/testing/file-naming.js.map +1 -0
- package/dist/testing/fixture-patterns.d.ts +52 -0
- package/dist/testing/fixture-patterns.d.ts.map +1 -0
- package/dist/testing/fixture-patterns.js +228 -0
- package/dist/testing/fixture-patterns.js.map +1 -0
- package/dist/testing/index.d.ts +31 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +49 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-patterns.d.ts +53 -0
- package/dist/testing/mock-patterns.d.ts.map +1 -0
- package/dist/testing/mock-patterns.js +264 -0
- package/dist/testing/mock-patterns.js.map +1 -0
- package/dist/testing/setup-teardown.d.ts +55 -0
- package/dist/testing/setup-teardown.d.ts.map +1 -0
- package/dist/testing/setup-teardown.js +262 -0
- package/dist/testing/setup-teardown.js.map +1 -0
- package/dist/testing/test-structure.d.ts +51 -0
- package/dist/testing/test-structure.d.ts.map +1 -0
- package/dist/testing/test-structure.js +225 -0
- package/dist/testing/test-structure.js.map +1 -0
- package/dist/types/any-usage.d.ts +99 -0
- package/dist/types/any-usage.d.ts.map +1 -0
- package/dist/types/any-usage.js +641 -0
- package/dist/types/any-usage.js.map +1 -0
- package/dist/types/file-location.d.ts +76 -0
- package/dist/types/file-location.d.ts.map +1 -0
- package/dist/types/file-location.js +395 -0
- package/dist/types/file-location.js.map +1 -0
- package/dist/types/generic-patterns.d.ts +97 -0
- package/dist/types/generic-patterns.d.ts.map +1 -0
- package/dist/types/generic-patterns.js +615 -0
- package/dist/types/generic-patterns.js.map +1 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +43 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface-vs-type.d.ts +81 -0
- package/dist/types/interface-vs-type.d.ts.map +1 -0
- package/dist/types/interface-vs-type.js +440 -0
- package/dist/types/interface-vs-type.js.map +1 -0
- package/dist/types/naming-conventions.d.ts +84 -0
- package/dist/types/naming-conventions.d.ts.map +1 -0
- package/dist/types/naming-conventions.js +455 -0
- package/dist/types/naming-conventions.js.map +1 -0
- package/dist/types/type-assertions.d.ts +98 -0
- package/dist/types/type-assertions.d.ts.map +1 -0
- package/dist/types/type-assertions.js +639 -0
- package/dist/types/type-assertions.js.map +1 -0
- package/dist/types/utility-types.d.ts +110 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/types/utility-types.js +547 -0
- package/dist/types/utility-types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation Detectors - Documentation pattern detection
|
|
3
|
+
* @requirements 21.1-21.5 - Documentation pattern detection
|
|
4
|
+
*/
|
|
5
|
+
export { JsdocPatternsDetector, createJsdocPatternsDetector, analyzeJsdocPatterns, shouldExcludeFile as shouldExcludeJsdoc, detectJsdocBlock, detectParamTag, detectReturnsTag, detectExampleTag, detectDeprecatedTag, detectSeeTag, detectThrowsTag, detectTypeTag, JSDOC_BLOCK_PATTERNS, PARAM_TAG_PATTERNS, RETURNS_TAG_PATTERNS, EXAMPLE_TAG_PATTERNS as JSDOC_EXAMPLE_TAG_PATTERNS } from './jsdoc-patterns.js';
|
|
6
|
+
export type { JsdocPatternType, JsdocViolationType, JsdocPatternInfo, JsdocViolationInfo, JsdocAnalysis } from './jsdoc-patterns.js';
|
|
7
|
+
export { ReadmeStructureDetector, createReadmeStructureDetector, analyzeReadmeStructure, shouldExcludeFile as shouldExcludeReadme, detectTitle, detectDescription, detectInstallation, detectUsage, detectApiSection, detectContributing, detectLicense, detectBadges, detectTableOfContents, TITLE_PATTERNS, INSTALLATION_PATTERNS, USAGE_PATTERNS, LICENSE_PATTERNS } from './readme-structure.js';
|
|
8
|
+
export type { ReadmePatternType, ReadmeViolationType, ReadmePatternInfo, ReadmeViolationInfo, ReadmeAnalysis } from './readme-structure.js';
|
|
9
|
+
export { TodoPatternsDetector, createTodoPatternsDetector, analyzeTodoPatterns, shouldExcludeFile as shouldExcludeTodo, detectTodo, detectFixme, detectHack, detectXxx, detectBug, detectNote, detectOptimize, detectReview, TODO_PATTERNS, FIXME_PATTERNS, HACK_PATTERNS, BUG_PATTERNS } from './todo-patterns.js';
|
|
10
|
+
export type { TodoPatternType, TodoViolationType, TodoPatternInfo, TodoViolationInfo, TodoAnalysis } from './todo-patterns.js';
|
|
11
|
+
export { DeprecationDetector, createDeprecationDetector, analyzeDeprecation, shouldExcludeFile as shouldExcludeDeprecation, detectJsdocDeprecated, detectDecoratorDeprecated, detectConsoleWarn, detectDeprecationNotice, detectLegacyMarker, JSDOC_DEPRECATED_PATTERNS, DECORATOR_DEPRECATED_PATTERNS, DEPRECATION_NOTICE_PATTERNS } from './deprecation.js';
|
|
12
|
+
export type { DeprecationPatternType, DeprecationViolationType, DeprecationPatternInfo, DeprecationViolationInfo, DeprecationAnalysis } from './deprecation.js';
|
|
13
|
+
export { ExampleCodeDetector, createExampleCodeDetector, analyzeExampleCode, shouldExcludeFile as shouldExcludeExampleCode, detectCodeBlock, detectInlineCode, detectExampleTag as detectExampleCodeTag, detectUsageExample, detectSnippet, detectDemoCode, CODE_BLOCK_PATTERNS, INLINE_CODE_PATTERNS, EXAMPLE_TAG_PATTERNS } from './example-code.js';
|
|
14
|
+
export type { ExampleCodePatternType, ExampleCodeViolationType, ExampleCodePatternInfo, ExampleCodeViolationInfo, ExampleCodeAnalysis } from './example-code.js';
|
|
15
|
+
import { JsdocPatternsDetector } from './jsdoc-patterns.js';
|
|
16
|
+
import { ReadmeStructureDetector } from './readme-structure.js';
|
|
17
|
+
import { TodoPatternsDetector } from './todo-patterns.js';
|
|
18
|
+
import { DeprecationDetector } from './deprecation.js';
|
|
19
|
+
import { ExampleCodeDetector } from './example-code.js';
|
|
20
|
+
export type DocumentationDetector = JsdocPatternsDetector | ReadmeStructureDetector | TodoPatternsDetector | DeprecationDetector | ExampleCodeDetector;
|
|
21
|
+
export declare function createDocumentationDetectors(): DocumentationDetector[];
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documentation/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACrZ,YAAY,E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E,kBAAkB,EAAE,iBAAiB,IAAI,wBAAwB,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACvV,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGjK,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,uBAAuB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAEvJ,wBAAgB,4BAA4B,IAAI,qBAAqB,EAAE,CAEtE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation Detectors - Documentation pattern detection
|
|
3
|
+
* @requirements 21.1-21.5 - Documentation pattern detection
|
|
4
|
+
*/
|
|
5
|
+
export { JsdocPatternsDetector, createJsdocPatternsDetector, analyzeJsdocPatterns, shouldExcludeFile as shouldExcludeJsdoc, detectJsdocBlock, detectParamTag, detectReturnsTag, detectExampleTag, detectDeprecatedTag, detectSeeTag, detectThrowsTag, detectTypeTag, JSDOC_BLOCK_PATTERNS, PARAM_TAG_PATTERNS, RETURNS_TAG_PATTERNS, EXAMPLE_TAG_PATTERNS as JSDOC_EXAMPLE_TAG_PATTERNS } from './jsdoc-patterns.js';
|
|
6
|
+
export { ReadmeStructureDetector, createReadmeStructureDetector, analyzeReadmeStructure, shouldExcludeFile as shouldExcludeReadme, detectTitle, detectDescription, detectInstallation, detectUsage, detectApiSection, detectContributing, detectLicense, detectBadges, detectTableOfContents, TITLE_PATTERNS, INSTALLATION_PATTERNS, USAGE_PATTERNS, LICENSE_PATTERNS } from './readme-structure.js';
|
|
7
|
+
export { TodoPatternsDetector, createTodoPatternsDetector, analyzeTodoPatterns, shouldExcludeFile as shouldExcludeTodo, detectTodo, detectFixme, detectHack, detectXxx, detectBug, detectNote, detectOptimize, detectReview, TODO_PATTERNS, FIXME_PATTERNS, HACK_PATTERNS, BUG_PATTERNS } from './todo-patterns.js';
|
|
8
|
+
export { DeprecationDetector, createDeprecationDetector, analyzeDeprecation, shouldExcludeFile as shouldExcludeDeprecation, detectJsdocDeprecated, detectDecoratorDeprecated, detectConsoleWarn, detectDeprecationNotice, detectLegacyMarker, JSDOC_DEPRECATED_PATTERNS, DECORATOR_DEPRECATED_PATTERNS, DEPRECATION_NOTICE_PATTERNS } from './deprecation.js';
|
|
9
|
+
export { ExampleCodeDetector, createExampleCodeDetector, analyzeExampleCode, shouldExcludeFile as shouldExcludeExampleCode, detectCodeBlock, detectInlineCode, detectExampleTag as detectExampleCodeTag, detectUsageExample, detectSnippet, detectDemoCode, CODE_BLOCK_PATTERNS, INLINE_CODE_PATTERNS, EXAMPLE_TAG_PATTERNS } from './example-code.js';
|
|
10
|
+
// Factory Function
|
|
11
|
+
import { JsdocPatternsDetector } from './jsdoc-patterns.js';
|
|
12
|
+
import { ReadmeStructureDetector } from './readme-structure.js';
|
|
13
|
+
import { TodoPatternsDetector } from './todo-patterns.js';
|
|
14
|
+
import { DeprecationDetector } from './deprecation.js';
|
|
15
|
+
import { ExampleCodeDetector } from './example-code.js';
|
|
16
|
+
export function createDocumentationDetectors() {
|
|
17
|
+
return [new JsdocPatternsDetector(), new ReadmeStructureDetector(), new TodoPatternsDetector(), new DeprecationDetector(), new ExampleCodeDetector()];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMapping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BAAkB,EAAE,iBAAiB,IAAI,wBAAwB,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGvV,mBAAmB;AACnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,UAAU,4BAA4B;IAC1C,OAAO,CAAC,IAAI,qBAAqB,EAAE,EAAE,IAAI,uBAAuB,EAAE,EAAE,IAAI,oBAAoB,EAAE,EAAE,IAAI,mBAAmB,EAAE,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;AACxJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSDoc Patterns Detector - JSDoc documentation pattern detection
|
|
3
|
+
* @requirements 21.1 - JSDoc patterns
|
|
4
|
+
*/
|
|
5
|
+
import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
|
|
6
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
7
|
+
import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
|
|
8
|
+
export type JsdocPatternType = 'jsdoc-block' | 'param-tag' | 'returns-tag' | 'example-tag' | 'deprecated-tag' | 'see-tag' | 'throws-tag' | 'type-tag';
|
|
9
|
+
export type JsdocViolationType = 'missing-jsdoc' | 'incomplete-jsdoc' | 'outdated-jsdoc';
|
|
10
|
+
export interface JsdocPatternInfo {
|
|
11
|
+
type: JsdocPatternType;
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
matchedText: string;
|
|
16
|
+
context?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface JsdocViolationInfo {
|
|
19
|
+
type: JsdocViolationType;
|
|
20
|
+
file: string;
|
|
21
|
+
line: number;
|
|
22
|
+
column: number;
|
|
23
|
+
matchedText: string;
|
|
24
|
+
issue: string;
|
|
25
|
+
suggestedFix?: string | undefined;
|
|
26
|
+
severity: 'high' | 'medium' | 'low';
|
|
27
|
+
}
|
|
28
|
+
export interface JsdocAnalysis {
|
|
29
|
+
patterns: JsdocPatternInfo[];
|
|
30
|
+
violations: JsdocViolationInfo[];
|
|
31
|
+
jsdocBlockCount: number;
|
|
32
|
+
paramTagCount: number;
|
|
33
|
+
hasExamples: boolean;
|
|
34
|
+
confidence: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const JSDOC_BLOCK_PATTERNS: readonly [RegExp];
|
|
37
|
+
export declare const PARAM_TAG_PATTERNS: readonly [RegExp, RegExp];
|
|
38
|
+
export declare const RETURNS_TAG_PATTERNS: readonly [RegExp, RegExp];
|
|
39
|
+
export declare const EXAMPLE_TAG_PATTERNS: readonly [RegExp];
|
|
40
|
+
export declare const DEPRECATED_TAG_PATTERNS: readonly [RegExp];
|
|
41
|
+
export declare const SEE_TAG_PATTERNS: readonly [RegExp];
|
|
42
|
+
export declare const THROWS_TAG_PATTERNS: readonly [RegExp];
|
|
43
|
+
export declare const TYPE_TAG_PATTERNS: readonly [RegExp];
|
|
44
|
+
export declare const MISSING_JSDOC_PATTERNS: readonly [RegExp, RegExp];
|
|
45
|
+
export declare const PYTHON_DOCSTRING_PATTERNS: readonly [RegExp, RegExp];
|
|
46
|
+
export declare const PYTHON_PARAM_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
47
|
+
export declare const PYTHON_RETURNS_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
48
|
+
export declare const PYTHON_RAISES_PATTERNS: readonly [RegExp, RegExp];
|
|
49
|
+
export declare const PYTHON_EXAMPLE_PATTERNS: readonly [RegExp, RegExp];
|
|
50
|
+
export declare const PYTHON_NOTE_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
51
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
52
|
+
export declare function detectJsdocBlock(content: string, filePath: string): JsdocPatternInfo[];
|
|
53
|
+
export declare function detectParamTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
54
|
+
export declare function detectReturnsTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
55
|
+
export declare function detectExampleTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
56
|
+
export declare function detectDeprecatedTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
57
|
+
export declare function detectSeeTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
58
|
+
export declare function detectThrowsTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
59
|
+
export declare function detectTypeTag(content: string, filePath: string): JsdocPatternInfo[];
|
|
60
|
+
export declare function analyzeJsdocPatterns(content: string, filePath: string): JsdocAnalysis;
|
|
61
|
+
export declare class JsdocPatternsDetector extends RegexDetector {
|
|
62
|
+
readonly id = "documentation/jsdoc-patterns";
|
|
63
|
+
readonly name = "JSDoc Patterns Detector";
|
|
64
|
+
readonly description = "Detects JSDoc documentation patterns";
|
|
65
|
+
readonly category: PatternCategory;
|
|
66
|
+
readonly subcategory = "jsdoc-patterns";
|
|
67
|
+
readonly supportedLanguages: Language[];
|
|
68
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
69
|
+
generateQuickFix(_violation: Violation): QuickFix | null;
|
|
70
|
+
}
|
|
71
|
+
export declare function createJsdocPatternsDetector(): JsdocPatternsDetector;
|
|
72
|
+
//# sourceMappingURL=jsdoc-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc-patterns.d.ts","sourceRoot":"","sources":["../../src/documentation/jsdoc-patterns.ts"],"names":[],"mappings":"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E,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAA2E;AAC9J,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAiF;AACvK,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAA6E;AAEjK,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAYrF;AAED,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,QAAQ,CAAC,EAAE,kCAAkC;IAC7C,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,WAAW,0CAA0C;IAC9D,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAmB;IACrD,QAAQ,CAAC,WAAW,oBAAoB;IACxC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAA0C;IAE3E,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAOjE,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI;CACzD;AAED,wBAAgB,2BAA2B,IAAI,qBAAqB,CAAwC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSDoc Patterns Detector - JSDoc documentation pattern detection
|
|
3
|
+
* @requirements 21.1 - JSDoc patterns
|
|
4
|
+
*/
|
|
5
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
6
|
+
// JavaScript/TypeScript JSDoc patterns
|
|
7
|
+
export const JSDOC_BLOCK_PATTERNS = [/\/\*\*[\s\S]*?\*\//g];
|
|
8
|
+
export const PARAM_TAG_PATTERNS = [/@param\s+\{[^}]+\}\s+\w+/g, /@param\s+\w+/g];
|
|
9
|
+
export const RETURNS_TAG_PATTERNS = [/@returns?\s+\{[^}]+\}/g, /@returns?\s+\w+/g];
|
|
10
|
+
export const EXAMPLE_TAG_PATTERNS = [/@example/g];
|
|
11
|
+
export const DEPRECATED_TAG_PATTERNS = [/@deprecated/g];
|
|
12
|
+
export const SEE_TAG_PATTERNS = [/@see\s+/g];
|
|
13
|
+
export const THROWS_TAG_PATTERNS = [/@throws?\s+\{[^}]+\}/g];
|
|
14
|
+
export const TYPE_TAG_PATTERNS = [/@type\s+\{[^}]+\}/g];
|
|
15
|
+
export const MISSING_JSDOC_PATTERNS = [/^export\s+(?:async\s+)?function\s+\w+/gm, /^export\s+class\s+\w+/gm];
|
|
16
|
+
// Python docstring patterns (Google, NumPy, Sphinx styles)
|
|
17
|
+
export const PYTHON_DOCSTRING_PATTERNS = [/"""[\s\S]*?"""/g, /'''[\s\S]*?'''/g];
|
|
18
|
+
export const PYTHON_PARAM_PATTERNS = [/:param\s+\w+:/g, /Args:\s*\n/g, /Parameters\s*\n\s*-+/g, /:type\s+\w+:/g];
|
|
19
|
+
export const PYTHON_RETURNS_PATTERNS = [/:returns?:/g, /Returns:\s*\n/g, /:rtype:/g];
|
|
20
|
+
export const PYTHON_RAISES_PATTERNS = [/:raises?\s+\w+:/g, /Raises:\s*\n/g];
|
|
21
|
+
export const PYTHON_EXAMPLE_PATTERNS = [/Examples?:\s*\n/g, />>>/g];
|
|
22
|
+
export const PYTHON_NOTE_PATTERNS = [/Note:\s*\n/g, /Notes:\s*\n/g, /\.\.\s*note::/g];
|
|
23
|
+
export function shouldExcludeFile(filePath) {
|
|
24
|
+
return [/\.test\.[jt]sx?$/, /\.spec\.[jt]sx?$/, /__tests__\//, /node_modules\//, /\.min\.[jt]s$/, /\.d\.ts$/, /test_.*\.py$/, /_test\.py$/, /__pycache__\//, /\.pyc$/].some((p) => p.test(filePath));
|
|
25
|
+
}
|
|
26
|
+
// Python docstring detection functions
|
|
27
|
+
function detectPythonDocstring(content, filePath) { return detectPatterns(content, filePath, PYTHON_DOCSTRING_PATTERNS, 'jsdoc-block'); }
|
|
28
|
+
function detectPythonParam(content, filePath) { return detectPatterns(content, filePath, PYTHON_PARAM_PATTERNS, 'param-tag'); }
|
|
29
|
+
function detectPythonReturns(content, filePath) { return detectPatterns(content, filePath, PYTHON_RETURNS_PATTERNS, 'returns-tag'); }
|
|
30
|
+
function detectPythonRaises(content, filePath) { return detectPatterns(content, filePath, PYTHON_RAISES_PATTERNS, 'throws-tag'); }
|
|
31
|
+
function detectPythonExample(content, filePath) { return detectPatterns(content, filePath, PYTHON_EXAMPLE_PATTERNS, 'example-tag'); }
|
|
32
|
+
function detectPatterns(content, filePath, patterns, type) {
|
|
33
|
+
const results = [];
|
|
34
|
+
const lines = content.split('\n');
|
|
35
|
+
for (let i = 0; i < lines.length; i++) {
|
|
36
|
+
const line = lines[i];
|
|
37
|
+
for (const pattern of patterns) {
|
|
38
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
39
|
+
let match;
|
|
40
|
+
while ((match = regex.exec(line)) !== null) {
|
|
41
|
+
results.push({ type, file: filePath, line: i + 1, column: match.index + 1, matchedText: match[0].slice(0, 50), context: line.trim() });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return results;
|
|
46
|
+
}
|
|
47
|
+
export function detectJsdocBlock(content, filePath) { return detectPatterns(content, filePath, JSDOC_BLOCK_PATTERNS, 'jsdoc-block'); }
|
|
48
|
+
export function detectParamTag(content, filePath) { return detectPatterns(content, filePath, PARAM_TAG_PATTERNS, 'param-tag'); }
|
|
49
|
+
export function detectReturnsTag(content, filePath) { return detectPatterns(content, filePath, RETURNS_TAG_PATTERNS, 'returns-tag'); }
|
|
50
|
+
export function detectExampleTag(content, filePath) { return detectPatterns(content, filePath, EXAMPLE_TAG_PATTERNS, 'example-tag'); }
|
|
51
|
+
export function detectDeprecatedTag(content, filePath) { return detectPatterns(content, filePath, DEPRECATED_TAG_PATTERNS, 'deprecated-tag'); }
|
|
52
|
+
export function detectSeeTag(content, filePath) { return detectPatterns(content, filePath, SEE_TAG_PATTERNS, 'see-tag'); }
|
|
53
|
+
export function detectThrowsTag(content, filePath) { return detectPatterns(content, filePath, THROWS_TAG_PATTERNS, 'throws-tag'); }
|
|
54
|
+
export function detectTypeTag(content, filePath) { return detectPatterns(content, filePath, TYPE_TAG_PATTERNS, 'type-tag'); }
|
|
55
|
+
export function analyzeJsdocPatterns(content, filePath) {
|
|
56
|
+
if (shouldExcludeFile(filePath))
|
|
57
|
+
return { patterns: [], violations: [], jsdocBlockCount: 0, paramTagCount: 0, hasExamples: false, confidence: 1.0 };
|
|
58
|
+
const isPython = filePath.endsWith('.py');
|
|
59
|
+
const patterns = isPython
|
|
60
|
+
? [...detectPythonDocstring(content, filePath), ...detectPythonParam(content, filePath), ...detectPythonReturns(content, filePath), ...detectPythonRaises(content, filePath), ...detectPythonExample(content, filePath)]
|
|
61
|
+
: [...detectJsdocBlock(content, filePath), ...detectParamTag(content, filePath), ...detectReturnsTag(content, filePath), ...detectExampleTag(content, filePath), ...detectDeprecatedTag(content, filePath), ...detectSeeTag(content, filePath), ...detectThrowsTag(content, filePath), ...detectTypeTag(content, filePath)];
|
|
62
|
+
const violations = [];
|
|
63
|
+
const jsdocBlockCount = patterns.filter((p) => p.type === 'jsdoc-block').length;
|
|
64
|
+
const paramTagCount = patterns.filter((p) => p.type === 'param-tag').length;
|
|
65
|
+
const hasExamples = patterns.some((p) => p.type === 'example-tag');
|
|
66
|
+
let confidence = 0.7;
|
|
67
|
+
if (patterns.length > 0)
|
|
68
|
+
confidence += 0.15;
|
|
69
|
+
if (hasExamples)
|
|
70
|
+
confidence += 0.1;
|
|
71
|
+
confidence = Math.min(confidence, 0.95);
|
|
72
|
+
return { patterns, violations, jsdocBlockCount, paramTagCount, hasExamples, confidence };
|
|
73
|
+
}
|
|
74
|
+
export class JsdocPatternsDetector extends RegexDetector {
|
|
75
|
+
id = 'documentation/jsdoc-patterns';
|
|
76
|
+
name = 'JSDoc Patterns Detector';
|
|
77
|
+
description = 'Detects JSDoc documentation patterns';
|
|
78
|
+
category = 'documentation';
|
|
79
|
+
subcategory = 'jsdoc-patterns';
|
|
80
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
81
|
+
async detect(context) {
|
|
82
|
+
if (!this.supportsLanguage(context.language))
|
|
83
|
+
return this.createEmptyResult();
|
|
84
|
+
const analysis = analyzeJsdocPatterns(context.content, context.file);
|
|
85
|
+
if (analysis.patterns.length === 0 && analysis.violations.length === 0)
|
|
86
|
+
return this.createEmptyResult();
|
|
87
|
+
return this.createResult([], [], analysis.confidence, { custom: { patterns: analysis.patterns, violations: analysis.violations, jsdocBlockCount: analysis.jsdocBlockCount, paramTagCount: analysis.paramTagCount, hasExamples: analysis.hasExamples } });
|
|
88
|
+
}
|
|
89
|
+
generateQuickFix(_violation) { return null; }
|
|
90
|
+
}
|
|
91
|
+
export function createJsdocPatternsDetector() { return new JsdocPatternsDetector(); }
|
|
92
|
+
//# sourceMappingURL=jsdoc-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc-patterns.js","sourceRoot":"","sources":["../../src/documentation/jsdoc-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAU1D,uCAAuC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,qBAAqB,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,2BAA2B,EAAE,eAAe,CAAU,CAAC;AAC1F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,wBAAwB,EAAE,kBAAkB,CAAU,CAAC;AAC5F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAW,CAAU,CAAC;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,cAAc,CAAU,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,CAAU,CAAC;AACtD,MAAM,CAAC,MAAM,mBAAmB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M,QAAQ,GAAG,oBAAoB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxG,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC,eAAe,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC3P,CAAC;IAED,gBAAgB,CAAC,UAAqB,IAAqB,OAAO,IAAI,CAAC,CAAC,CAAC;CAC1E;AAED,MAAM,UAAU,2BAA2B,KAA4B,OAAO,IAAI,qBAAqB,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* README Structure Detector - README documentation pattern detection
|
|
3
|
+
* @requirements 21.2 - README structure patterns
|
|
4
|
+
*/
|
|
5
|
+
import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
|
|
6
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
7
|
+
import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
|
|
8
|
+
export type ReadmePatternType = 'title' | 'description' | 'installation' | 'usage' | 'api-section' | 'contributing' | 'license' | 'badges' | 'table-of-contents';
|
|
9
|
+
export type ReadmeViolationType = 'missing-title' | 'missing-installation' | 'missing-usage';
|
|
10
|
+
export interface ReadmePatternInfo {
|
|
11
|
+
type: ReadmePatternType;
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
matchedText: string;
|
|
16
|
+
context?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface ReadmeViolationInfo {
|
|
19
|
+
type: ReadmeViolationType;
|
|
20
|
+
file: string;
|
|
21
|
+
line: number;
|
|
22
|
+
column: number;
|
|
23
|
+
matchedText: string;
|
|
24
|
+
issue: string;
|
|
25
|
+
suggestedFix?: string | undefined;
|
|
26
|
+
severity: 'high' | 'medium' | 'low';
|
|
27
|
+
}
|
|
28
|
+
export interface ReadmeAnalysis {
|
|
29
|
+
patterns: ReadmePatternInfo[];
|
|
30
|
+
violations: ReadmeViolationInfo[];
|
|
31
|
+
sectionCount: number;
|
|
32
|
+
hasInstallation: boolean;
|
|
33
|
+
hasUsage: boolean;
|
|
34
|
+
confidence: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const TITLE_PATTERNS: readonly [RegExp];
|
|
37
|
+
export declare const DESCRIPTION_PATTERNS: readonly [RegExp, RegExp];
|
|
38
|
+
export declare const INSTALLATION_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
39
|
+
export declare const USAGE_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
40
|
+
export declare const API_SECTION_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
41
|
+
export declare const CONTRIBUTING_PATTERNS: readonly [RegExp, RegExp];
|
|
42
|
+
export declare const LICENSE_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
43
|
+
export declare const BADGES_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
44
|
+
export declare const TABLE_OF_CONTENTS_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
45
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
46
|
+
export declare function detectTitle(content: string, filePath: string): ReadmePatternInfo[];
|
|
47
|
+
export declare function detectDescription(content: string, filePath: string): ReadmePatternInfo[];
|
|
48
|
+
export declare function detectInstallation(content: string, filePath: string): ReadmePatternInfo[];
|
|
49
|
+
export declare function detectUsage(content: string, filePath: string): ReadmePatternInfo[];
|
|
50
|
+
export declare function detectApiSection(content: string, filePath: string): ReadmePatternInfo[];
|
|
51
|
+
export declare function detectContributing(content: string, filePath: string): ReadmePatternInfo[];
|
|
52
|
+
export declare function detectLicense(content: string, filePath: string): ReadmePatternInfo[];
|
|
53
|
+
export declare function detectBadges(content: string, filePath: string): ReadmePatternInfo[];
|
|
54
|
+
export declare function detectTableOfContents(content: string, filePath: string): ReadmePatternInfo[];
|
|
55
|
+
export declare function analyzeReadmeStructure(content: string, filePath: string): ReadmeAnalysis;
|
|
56
|
+
export declare class ReadmeStructureDetector extends RegexDetector {
|
|
57
|
+
readonly id = "documentation/readme-structure";
|
|
58
|
+
readonly name = "README Structure Detector";
|
|
59
|
+
readonly description = "Detects README documentation structure patterns";
|
|
60
|
+
readonly category: PatternCategory;
|
|
61
|
+
readonly subcategory = "readme-structure";
|
|
62
|
+
readonly supportedLanguages: Language[];
|
|
63
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
64
|
+
generateQuickFix(_violation: Violation): QuickFix | null;
|
|
65
|
+
}
|
|
66
|
+
export declare function createReadmeStructureDetector(): ReadmeStructureDetector;
|
|
67
|
+
//# sourceMappingURL=readme-structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme-structure.d.ts","sourceRoot":"","sources":["../../src/documentation/readme-structure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,GAAG,SAAS,GAA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AC,QAAQ,EAAE,eAAe,CAAmB;IACrD,QAAQ,CAAC,WAAW,sBAAsB;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAgB;IAEjD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAOjE,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI;CACzD;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAA0C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* README Structure Detector - README documentation pattern detection
|
|
3
|
+
* @requirements 21.2 - README structure patterns
|
|
4
|
+
*/
|
|
5
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
6
|
+
export const TITLE_PATTERNS = [/^#\s+.+$/gm];
|
|
7
|
+
export const DESCRIPTION_PATTERNS = [/^>\s+.+$/gm, /^[A-Z][^#\n]+\.$/gm];
|
|
8
|
+
export const INSTALLATION_PATTERNS = [/^##?\s+Installation/gim, /^##?\s+Getting Started/gim, /^##?\s+Setup/gim];
|
|
9
|
+
export const USAGE_PATTERNS = [/^##?\s+Usage/gim, /^##?\s+Examples?/gim, /^##?\s+Quick Start/gim];
|
|
10
|
+
export const API_SECTION_PATTERNS = [/^##?\s+API/gim, /^##?\s+Reference/gim, /^##?\s+Documentation/gim];
|
|
11
|
+
export const CONTRIBUTING_PATTERNS = [/^##?\s+Contributing/gim, /^##?\s+Development/gim];
|
|
12
|
+
export const LICENSE_PATTERNS = [/^##?\s+License/gim, /MIT License/g, /Apache License/g];
|
|
13
|
+
export const BADGES_PATTERNS = [/\[!\[.+\]\(.+\)\]\(.+\)/g, /!\[.+\]\(https:\/\/img\.shields\.io/g, /!\[.+\]\(https:\/\/badge/g];
|
|
14
|
+
export const TABLE_OF_CONTENTS_PATTERNS = [/^##?\s+Table of Contents/gim, /^##?\s+Contents/gim, /- \[.+\]\(#.+\)/g];
|
|
15
|
+
export function shouldExcludeFile(filePath) {
|
|
16
|
+
return ![/README\.md$/i, /readme\.md$/i].some((p) => p.test(filePath));
|
|
17
|
+
}
|
|
18
|
+
function detectPatterns(content, filePath, patterns, type) {
|
|
19
|
+
const results = [];
|
|
20
|
+
const lines = content.split('\n');
|
|
21
|
+
for (let i = 0; i < lines.length; i++) {
|
|
22
|
+
const line = lines[i];
|
|
23
|
+
for (const pattern of patterns) {
|
|
24
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
25
|
+
let match;
|
|
26
|
+
while ((match = regex.exec(line)) !== null) {
|
|
27
|
+
results.push({ type, file: filePath, line: i + 1, column: match.index + 1, matchedText: match[0].slice(0, 50), context: line.trim() });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return results;
|
|
32
|
+
}
|
|
33
|
+
export function detectTitle(content, filePath) { return detectPatterns(content, filePath, TITLE_PATTERNS, 'title'); }
|
|
34
|
+
export function detectDescription(content, filePath) { return detectPatterns(content, filePath, DESCRIPTION_PATTERNS, 'description'); }
|
|
35
|
+
export function detectInstallation(content, filePath) { return detectPatterns(content, filePath, INSTALLATION_PATTERNS, 'installation'); }
|
|
36
|
+
export function detectUsage(content, filePath) { return detectPatterns(content, filePath, USAGE_PATTERNS, 'usage'); }
|
|
37
|
+
export function detectApiSection(content, filePath) { return detectPatterns(content, filePath, API_SECTION_PATTERNS, 'api-section'); }
|
|
38
|
+
export function detectContributing(content, filePath) { return detectPatterns(content, filePath, CONTRIBUTING_PATTERNS, 'contributing'); }
|
|
39
|
+
export function detectLicense(content, filePath) { return detectPatterns(content, filePath, LICENSE_PATTERNS, 'license'); }
|
|
40
|
+
export function detectBadges(content, filePath) { return detectPatterns(content, filePath, BADGES_PATTERNS, 'badges'); }
|
|
41
|
+
export function detectTableOfContents(content, filePath) { return detectPatterns(content, filePath, TABLE_OF_CONTENTS_PATTERNS, 'table-of-contents'); }
|
|
42
|
+
export function analyzeReadmeStructure(content, filePath) {
|
|
43
|
+
if (shouldExcludeFile(filePath))
|
|
44
|
+
return { patterns: [], violations: [], sectionCount: 0, hasInstallation: false, hasUsage: false, confidence: 1.0 };
|
|
45
|
+
const patterns = [...detectTitle(content, filePath), ...detectDescription(content, filePath), ...detectInstallation(content, filePath), ...detectUsage(content, filePath), ...detectApiSection(content, filePath), ...detectContributing(content, filePath), ...detectLicense(content, filePath), ...detectBadges(content, filePath), ...detectTableOfContents(content, filePath)];
|
|
46
|
+
const violations = [];
|
|
47
|
+
const sectionCount = patterns.length;
|
|
48
|
+
const hasInstallation = patterns.some((p) => p.type === 'installation');
|
|
49
|
+
const hasUsage = patterns.some((p) => p.type === 'usage');
|
|
50
|
+
let confidence = 0.7;
|
|
51
|
+
if (patterns.length > 0)
|
|
52
|
+
confidence += 0.15;
|
|
53
|
+
if (hasInstallation && hasUsage)
|
|
54
|
+
confidence += 0.1;
|
|
55
|
+
confidence = Math.min(confidence, 0.95);
|
|
56
|
+
return { patterns, violations, sectionCount, hasInstallation, hasUsage, confidence };
|
|
57
|
+
}
|
|
58
|
+
export class ReadmeStructureDetector extends RegexDetector {
|
|
59
|
+
id = 'documentation/readme-structure';
|
|
60
|
+
name = 'README Structure Detector';
|
|
61
|
+
description = 'Detects README documentation structure patterns';
|
|
62
|
+
category = 'documentation';
|
|
63
|
+
subcategory = 'readme-structure';
|
|
64
|
+
supportedLanguages = ['markdown'];
|
|
65
|
+
async detect(context) {
|
|
66
|
+
if (!this.supportsLanguage(context.language) && !context.file.toLowerCase().includes('readme'))
|
|
67
|
+
return this.createEmptyResult();
|
|
68
|
+
const analysis = analyzeReadmeStructure(context.content, context.file);
|
|
69
|
+
if (analysis.patterns.length === 0 && analysis.violations.length === 0)
|
|
70
|
+
return this.createEmptyResult();
|
|
71
|
+
return this.createResult([], [], analysis.confidence, { custom: { patterns: analysis.patterns, violations: analysis.violations, sectionCount: analysis.sectionCount, hasInstallation: analysis.hasInstallation, hasUsage: analysis.hasUsage } });
|
|
72
|
+
}
|
|
73
|
+
generateQuickFix(_violation) { return null; }
|
|
74
|
+
}
|
|
75
|
+
export function createReadmeStructureDetector() { return new ReadmeStructureDetector(); }
|
|
76
|
+
//# sourceMappingURL=readme-structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme-structure.js","sourceRoot":"","sources":["../../src/documentation/readme-structure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAU1D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,YAAY,CAAU,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,YAAY,EAAE,oBAAoB,CAAU,CAAC;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,wBAAwB,EAAE,2BAA2B,EAAE,iBAAiB,CAAU,CAAC;AACzH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,uBAAuB,CAAU,CAAC;AAC3G,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,qBAAqB,EAAE,yBAAyB,CAAU,CAAC;AACjH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,wBAAwB,EAAE,uBAAuB,CAAU,CAAC;AAClG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,mBAAmB,EAAE,cAAc,EAAE,iBAAiB,CAAU,CAAC;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,0BAA0B,EAAE,sCAAsC,EAAE,2BAA2B,CAAU,CAAC;AAC1I,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,6BAA6B,EAAE,oBAAoB,EAAE,kBAAkB,CAAU,CAAC;AAE7H,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,Q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AAI,uBAAuB,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO Patterns Detector - TODO/FIXME comment pattern detection
|
|
3
|
+
* @requirements 21.3 - TODO patterns
|
|
4
|
+
*/
|
|
5
|
+
import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
|
|
6
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
7
|
+
import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
|
|
8
|
+
export type TodoPatternType = 'todo' | 'fixme' | 'hack' | 'xxx' | 'bug' | 'note' | 'optimize' | 'review';
|
|
9
|
+
export type TodoViolationType = 'stale-todo' | 'unassigned-todo';
|
|
10
|
+
export interface TodoPatternInfo {
|
|
11
|
+
type: TodoPatternType;
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
matchedText: string;
|
|
16
|
+
author?: string | undefined;
|
|
17
|
+
message?: string | undefined;
|
|
18
|
+
context?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface TodoViolationInfo {
|
|
21
|
+
type: TodoViolationType;
|
|
22
|
+
file: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
matchedText: string;
|
|
26
|
+
issue: string;
|
|
27
|
+
suggestedFix?: string | undefined;
|
|
28
|
+
severity: 'high' | 'medium' | 'low';
|
|
29
|
+
}
|
|
30
|
+
export interface TodoAnalysis {
|
|
31
|
+
patterns: TodoPatternInfo[];
|
|
32
|
+
violations: TodoViolationInfo[];
|
|
33
|
+
todoCount: number;
|
|
34
|
+
fixmeCount: number;
|
|
35
|
+
hackCount: number;
|
|
36
|
+
confidence: number;
|
|
37
|
+
}
|
|
38
|
+
export declare const TODO_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
39
|
+
export declare const FIXME_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
40
|
+
export declare const HACK_PATTERNS: readonly [RegExp, RegExp];
|
|
41
|
+
export declare const XXX_PATTERNS: readonly [RegExp];
|
|
42
|
+
export declare const BUG_PATTERNS: readonly [RegExp, RegExp];
|
|
43
|
+
export declare const NOTE_PATTERNS: readonly [RegExp, RegExp];
|
|
44
|
+
export declare const OPTIMIZE_PATTERNS: readonly [RegExp, RegExp];
|
|
45
|
+
export declare const REVIEW_PATTERNS: readonly [RegExp];
|
|
46
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
47
|
+
export declare function detectTodo(content: string, filePath: string): TodoPatternInfo[];
|
|
48
|
+
export declare function detectFixme(content: string, filePath: string): TodoPatternInfo[];
|
|
49
|
+
export declare function detectHack(content: string, filePath: string): TodoPatternInfo[];
|
|
50
|
+
export declare function detectXxx(content: string, filePath: string): TodoPatternInfo[];
|
|
51
|
+
export declare function detectBug(content: string, filePath: string): TodoPatternInfo[];
|
|
52
|
+
export declare function detectNote(content: string, filePath: string): TodoPatternInfo[];
|
|
53
|
+
export declare function detectOptimize(content: string, filePath: string): TodoPatternInfo[];
|
|
54
|
+
export declare function detectReview(content: string, filePath: string): TodoPatternInfo[];
|
|
55
|
+
export declare function analyzeTodoPatterns(content: string, filePath: string): TodoAnalysis;
|
|
56
|
+
export declare class TodoPatternsDetector extends RegexDetector {
|
|
57
|
+
readonly id = "documentation/todo-patterns";
|
|
58
|
+
readonly name = "TODO Patterns Detector";
|
|
59
|
+
readonly description = "Detects TODO/FIXME comment patterns";
|
|
60
|
+
readonly category: PatternCategory;
|
|
61
|
+
readonly subcategory = "todo-patterns";
|
|
62
|
+
readonly supportedLanguages: Language[];
|
|
63
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
64
|
+
generateQuickFix(_violation: Violation): QuickFix | null;
|
|
65
|
+
}
|
|
66
|
+
export declare function createTodoPatternsDetector(): TodoPatternsDetector;
|
|
67
|
+
//# sourceMappingURL=todo-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo-patterns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,EAAE,MAAM,GAAG,eAAe,EAAE,CAAyE;AAE3J,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CASnF;AAED,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,QAAQ,CAAC,EAAE,iCAAiC;IAC5C,QAAQ,CAAC,IAAI,4BAA4B;IACzC,QAAQ,CAAC,WAAW,yCAAyC;IAC7D,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAmB;IACrD,QAAQ,CAAC,WAAW,mBAAmB;IACvC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAA0C;IAE3E,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAOjE,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI;CACzD;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAAuC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO Patterns Detector - TODO/FIXME comment pattern detection
|
|
3
|
+
* @requirements 21.3 - TODO patterns
|
|
4
|
+
*/
|
|
5
|
+
import { RegexDetector } from '../base/regex-detector.js';
|
|
6
|
+
export const TODO_PATTERNS = [/\/\/\s*TODO:?\s*(.+)/gi, /\/\*\s*TODO:?\s*(.+)\*\//gi, /#\s*TODO:?\s*(.+)/gi];
|
|
7
|
+
export const FIXME_PATTERNS = [/\/\/\s*FIXME:?\s*(.+)/gi, /\/\*\s*FIXME:?\s*(.+)\*\//gi, /#\s*FIXME:?\s*(.+)/gi];
|
|
8
|
+
export const HACK_PATTERNS = [/\/\/\s*HACK:?\s*(.+)/gi, /\/\*\s*HACK:?\s*(.+)\*\//gi];
|
|
9
|
+
export const XXX_PATTERNS = [/\/\/\s*XXX:?\s*(.+)/gi];
|
|
10
|
+
export const BUG_PATTERNS = [/\/\/\s*BUG:?\s*(.+)/gi, /\/\*\s*BUG:?\s*(.+)\*\//gi];
|
|
11
|
+
export const NOTE_PATTERNS = [/\/\/\s*NOTE:?\s*(.+)/gi, /\/\*\s*NOTE:?\s*(.+)\*\//gi];
|
|
12
|
+
export const OPTIMIZE_PATTERNS = [/\/\/\s*OPTIMIZE:?\s*(.+)/gi, /\/\/\s*PERF:?\s*(.+)/gi];
|
|
13
|
+
export const REVIEW_PATTERNS = [/\/\/\s*REVIEW:?\s*(.+)/gi];
|
|
14
|
+
export function shouldExcludeFile(filePath) {
|
|
15
|
+
return [/node_modules\//, /\.min\.[jt]s$/].some((p) => p.test(filePath));
|
|
16
|
+
}
|
|
17
|
+
function detectPatterns(content, filePath, patterns, type) {
|
|
18
|
+
const results = [];
|
|
19
|
+
const lines = content.split('\n');
|
|
20
|
+
for (let i = 0; i < lines.length; i++) {
|
|
21
|
+
const line = lines[i];
|
|
22
|
+
for (const pattern of patterns) {
|
|
23
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
24
|
+
let match;
|
|
25
|
+
while ((match = regex.exec(line)) !== null) {
|
|
26
|
+
const authorMatch = match[1]?.match(/\(([^)]+)\)/);
|
|
27
|
+
results.push({ type, file: filePath, line: i + 1, column: match.index + 1, matchedText: match[0], author: authorMatch ? authorMatch[1] : undefined, message: match[1]?.replace(/\([^)]+\)\s*/, '').trim(), context: line.trim() });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return results;
|
|
32
|
+
}
|
|
33
|
+
export function detectTodo(content, filePath) { return detectPatterns(content, filePath, TODO_PATTERNS, 'todo'); }
|
|
34
|
+
export function detectFixme(content, filePath) { return detectPatterns(content, filePath, FIXME_PATTERNS, 'fixme'); }
|
|
35
|
+
export function detectHack(content, filePath) { return detectPatterns(content, filePath, HACK_PATTERNS, 'hack'); }
|
|
36
|
+
export function detectXxx(content, filePath) { return detectPatterns(content, filePath, XXX_PATTERNS, 'xxx'); }
|
|
37
|
+
export function detectBug(content, filePath) { return detectPatterns(content, filePath, BUG_PATTERNS, 'bug'); }
|
|
38
|
+
export function detectNote(content, filePath) { return detectPatterns(content, filePath, NOTE_PATTERNS, 'note'); }
|
|
39
|
+
export function detectOptimize(content, filePath) { return detectPatterns(content, filePath, OPTIMIZE_PATTERNS, 'optimize'); }
|
|
40
|
+
export function detectReview(content, filePath) { return detectPatterns(content, filePath, REVIEW_PATTERNS, 'review'); }
|
|
41
|
+
export function analyzeTodoPatterns(content, filePath) {
|
|
42
|
+
if (shouldExcludeFile(filePath))
|
|
43
|
+
return { patterns: [], violations: [], todoCount: 0, fixmeCount: 0, hackCount: 0, confidence: 1.0 };
|
|
44
|
+
const patterns = [...detectTodo(content, filePath), ...detectFixme(content, filePath), ...detectHack(content, filePath), ...detectXxx(content, filePath), ...detectBug(content, filePath), ...detectNote(content, filePath), ...detectOptimize(content, filePath), ...detectReview(content, filePath)];
|
|
45
|
+
const violations = [];
|
|
46
|
+
const todoCount = patterns.filter((p) => p.type === 'todo').length;
|
|
47
|
+
const fixmeCount = patterns.filter((p) => p.type === 'fixme').length;
|
|
48
|
+
const hackCount = patterns.filter((p) => p.type === 'hack').length;
|
|
49
|
+
let confidence = 0.7;
|
|
50
|
+
if (patterns.length > 0)
|
|
51
|
+
confidence += 0.2;
|
|
52
|
+
confidence = Math.min(confidence, 0.95);
|
|
53
|
+
return { patterns, violations, todoCount, fixmeCount, hackCount, confidence };
|
|
54
|
+
}
|
|
55
|
+
export class TodoPatternsDetector extends RegexDetector {
|
|
56
|
+
id = 'documentation/todo-patterns';
|
|
57
|
+
name = 'TODO Patterns Detector';
|
|
58
|
+
description = 'Detects TODO/FIXME comment patterns';
|
|
59
|
+
category = 'documentation';
|
|
60
|
+
subcategory = 'todo-patterns';
|
|
61
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
62
|
+
async detect(context) {
|
|
63
|
+
if (!this.supportsLanguage(context.language))
|
|
64
|
+
return this.createEmptyResult();
|
|
65
|
+
const analysis = analyzeTodoPatterns(context.content, context.file);
|
|
66
|
+
if (analysis.patterns.length === 0 && analysis.violations.length === 0)
|
|
67
|
+
return this.createEmptyResult();
|
|
68
|
+
return this.createResult([], [], analysis.confidence, { custom: { patterns: analysis.patterns, violations: analysis.violations, todoCount: analysis.todoCount, fixmeCount: analysis.fixmeCount, hackCount: analysis.hackCount } });
|
|
69
|
+
}
|
|
70
|
+
generateQuickFix(_violation) { return null; }
|
|
71
|
+
}
|
|
72
|
+
export function createTodoPatternsDetector() { return new TodoPatternsDetector(); }
|
|
73
|
+
//# sourceMappingURL=todo-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo-patterns.js","sourceRoot":"","sources":["../../src/documentation/todo-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAU1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,wBAAwB,EAAE,4BAA4B,EAAE,qBAAqB,CAAU,CAAC;AACtH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,yBAAyB,EAAE,6BAA6B,EAAE,sBAAsB,CAAU,CAAC;AAC1H,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,wBAAwB,EAAE,4BAA4B,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,uBAAuB,CAAU,CAAC;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,uBAAuB,EAAE,2BAA2B,CAAU,CAAC;AAC5F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,wBAAwB,EAAE,4BAA4B,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,4BAA4B,EAAE,wBAAwB,CAAU,CAAC;AACnG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,0BAA0B,CAAU,CAAC;AAErE,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC,IA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