@repometry/cli 0.0.0-stage → 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 +21 -0
- package/README.md +70 -2
- package/package.json +75 -4
- package/target/main/resources/language-catalog.json +77 -0
- package/target/main/resources/report/json/compact-json-v1.schema.json +24 -0
- package/target/main/resources/report/json/comparison-v1.schema.json +65 -0
- package/target/main/resources/report/json/config-v2.schema.json +224 -0
- package/target/main/resources/report/json/diff-coverage-v1.schema.json +55 -0
- package/target/main/resources/report/json/file-metrics-v1.schema.json +157 -0
- package/target/main/resources/report/json/metabranch-v1.schema.json +9 -0
- package/target/main/resources/report/json/metric-catalog-v1.schema.json +31 -0
- package/target/main/resources/report/json/pull-review-v1.schema.json +97 -0
- package/target/main/resources/report/json/pull-review-v2.schema.json +100 -0
- package/target/main/resources/report/json/report-v2.schema.json +534 -0
- package/target/main/resources/report/json/repository-summary-v1.schema.json +341 -0
- package/target/main/resources/report/json/viewer-inspection-v1.schema.json +534 -0
- package/target/main/resources/viewer/files.css +616 -0
- package/target/main/resources/viewer/index.html +120 -0
- package/target/main/resources/viewer/projects.html +52 -0
- package/target/main/resources/viewer/styles.css +579 -0
- package/target/main/resources/viewer/viewer-pulls.css +64 -0
- package/target/main/ts/api/cache/root.d.ts +2 -0
- package/target/main/ts/api/cache/root.js +21 -0
- package/target/main/ts/api/gh/github.d.ts +4 -0
- package/target/main/ts/api/gh/github.js +47 -0
- package/target/main/ts/api/git/blob-batch.d.ts +10 -0
- package/target/main/ts/api/git/blob-batch.js +107 -0
- package/target/main/ts/api/git/blob-history.d.ts +20 -0
- package/target/main/ts/api/git/blob-history.js +54 -0
- package/target/main/ts/api/git/changes.d.ts +27 -0
- package/target/main/ts/api/git/changes.js +117 -0
- package/target/main/ts/api/git/commit-metadata.d.ts +2 -0
- package/target/main/ts/api/git/commit-metadata.js +46 -0
- package/target/main/ts/api/git/git-churn.d.ts +9 -0
- package/target/main/ts/api/git/git-churn.js +72 -0
- package/target/main/ts/api/git/git-executable.d.ts +1 -0
- package/target/main/ts/api/git/git-executable.js +31 -0
- package/target/main/ts/api/git/git-reader.d.ts +24 -0
- package/target/main/ts/api/git/git-reader.js +113 -0
- package/target/main/ts/api/git/git.d.ts +47 -0
- package/target/main/ts/api/git/git.js +289 -0
- package/target/main/ts/api/git/inspection-source.d.ts +17 -0
- package/target/main/ts/api/git/inspection-source.js +36 -0
- package/target/main/ts/api/git/line-changes.d.ts +6 -0
- package/target/main/ts/api/git/line-changes.js +57 -0
- package/target/main/ts/api/git/local-sources.d.ts +5 -0
- package/target/main/ts/api/git/local-sources.js +48 -0
- package/target/main/ts/api/git/local.d.ts +7 -0
- package/target/main/ts/api/git/local.js +106 -0
- package/target/main/ts/api/git/source-cache.d.ts +1 -0
- package/target/main/ts/api/git/source-cache.js +42 -0
- package/target/main/ts/api/import/cobertura.d.ts +2 -0
- package/target/main/ts/api/import/cobertura.js +160 -0
- package/target/main/ts/api/import/coverage-xml.d.ts +7 -0
- package/target/main/ts/api/import/coverage-xml.js +135 -0
- package/target/main/ts/api/import/finding-import.d.ts +9 -0
- package/target/main/ts/api/import/finding-import.js +227 -0
- package/target/main/ts/api/import/go-cover.d.ts +13 -0
- package/target/main/ts/api/import/go-cover.js +150 -0
- package/target/main/ts/api/import/lcov-files.d.ts +12 -0
- package/target/main/ts/api/import/lcov-files.js +53 -0
- package/target/main/ts/api/import/profile-file.d.ts +4 -0
- package/target/main/ts/api/import/profile-file.js +17 -0
- package/target/main/ts/api/process/docker-tool-runner.d.ts +13 -0
- package/target/main/ts/api/process/docker-tool-runner.js +92 -0
- package/target/main/ts/api/process/failure.d.ts +1 -0
- package/target/main/ts/api/process/failure.js +12 -0
- package/target/main/ts/api/process/plugin.d.ts +13 -0
- package/target/main/ts/api/process/plugin.js +100 -0
- package/target/main/ts/api/process/tool-snapshot.d.ts +3 -0
- package/target/main/ts/api/process/tool-snapshot.js +26 -0
- package/target/main/ts/cli/arguments.d.ts +28 -0
- package/target/main/ts/cli/arguments.js +109 -0
- package/target/main/ts/cli/config.d.ts +63 -0
- package/target/main/ts/cli/config.js +165 -0
- package/target/main/ts/cli/imports.d.ts +9 -0
- package/target/main/ts/cli/imports.js +37 -0
- package/target/main/ts/cli/main.d.ts +2 -0
- package/target/main/ts/cli/main.js +4 -0
- package/target/main/ts/cli/range-inspection.d.ts +38 -0
- package/target/main/ts/cli/range-inspection.js +34 -0
- package/target/main/ts/cli/range-jobs.d.ts +23 -0
- package/target/main/ts/cli/range-jobs.js +152 -0
- package/target/main/ts/cli/range-worker.d.ts +1 -0
- package/target/main/ts/cli/range-worker.js +40 -0
- package/target/main/ts/cli/reporting.d.ts +42 -0
- package/target/main/ts/cli/reporting.js +98 -0
- package/target/main/ts/cli/revisions.d.ts +6 -0
- package/target/main/ts/cli/revisions.js +16 -0
- package/target/main/ts/cli/run.d.ts +2 -0
- package/target/main/ts/cli/run.js +306 -0
- package/target/main/ts/cli/store.d.ts +13 -0
- package/target/main/ts/cli/store.js +39 -0
- package/target/main/ts/compose/analysis-report.d.ts +6 -0
- package/target/main/ts/compose/analysis-report.js +132 -0
- package/target/main/ts/compose/analysis-results.d.ts +46 -0
- package/target/main/ts/compose/analysis-results.js +119 -0
- package/target/main/ts/compose/analysis-steps.d.ts +23 -0
- package/target/main/ts/compose/analysis-steps.js +217 -0
- package/target/main/ts/compose/analyze-snapshot.d.ts +7 -0
- package/target/main/ts/compose/analyze-snapshot.js +21 -0
- package/target/main/ts/compose/attach-churn.d.ts +2 -0
- package/target/main/ts/compose/attach-churn.js +50 -0
- package/target/main/ts/compose/built-ins.d.ts +6 -0
- package/target/main/ts/compose/built-ins.js +12 -0
- package/target/main/ts/compose/diff-coverage.d.ts +25 -0
- package/target/main/ts/compose/diff-coverage.js +82 -0
- package/target/main/ts/compose/distribution.d.ts +17 -0
- package/target/main/ts/compose/distribution.js +13 -0
- package/target/main/ts/compose/docker-image.d.ts +5 -0
- package/target/main/ts/compose/docker-image.js +49 -0
- package/target/main/ts/compose/file-selection.d.ts +9 -0
- package/target/main/ts/compose/file-selection.js +38 -0
- package/target/main/ts/compose/history-cache.d.ts +31 -0
- package/target/main/ts/compose/history-cache.js +62 -0
- package/target/main/ts/compose/inspect.d.ts +34 -0
- package/target/main/ts/compose/inspect.js +51 -0
- package/target/main/ts/compose/inspection-coverage.d.ts +9 -0
- package/target/main/ts/compose/inspection-coverage.js +9 -0
- package/target/main/ts/compose/js-plugin.d.ts +113 -0
- package/target/main/ts/compose/js-plugin.js +99 -0
- package/target/main/ts/compose/language-discovery.d.ts +12 -0
- package/target/main/ts/compose/language-discovery.js +51 -0
- package/target/main/ts/compose/languages.d.ts +64 -0
- package/target/main/ts/compose/languages.js +98 -0
- package/target/main/ts/compose/load-plugins.d.ts +6 -0
- package/target/main/ts/compose/load-plugins.js +71 -0
- package/target/main/ts/compose/parser-order.d.ts +20 -0
- package/target/main/ts/compose/parser-order.js +90 -0
- package/target/main/ts/compose/phases.d.ts +140 -0
- package/target/main/ts/compose/phases.js +147 -0
- package/target/main/ts/compose/plugin-list.d.ts +37 -0
- package/target/main/ts/compose/plugin-list.js +30 -0
- package/target/main/ts/compose/plugin-manifest.d.ts +14 -0
- package/target/main/ts/compose/plugin-manifest.js +50 -0
- package/target/main/ts/compose/plugin-options.d.ts +2 -0
- package/target/main/ts/compose/plugin-options.js +29 -0
- package/target/main/ts/compose/plugin-reference.d.ts +9 -0
- package/target/main/ts/compose/plugin-reference.js +40 -0
- package/target/main/ts/compose/plugin-requirements.d.ts +5 -0
- package/target/main/ts/compose/plugin-requirements.js +83 -0
- package/target/main/ts/compose/plugin-scope.d.ts +9 -0
- package/target/main/ts/compose/plugin-scope.js +60 -0
- package/target/main/ts/compose/process-plugins.d.ts +89 -0
- package/target/main/ts/compose/process-plugins.js +74 -0
- package/target/main/ts/compose/registered-plugin.d.ts +17 -0
- package/target/main/ts/compose/registered-plugin.js +8 -0
- package/target/main/ts/compose/review.d.ts +26 -0
- package/target/main/ts/compose/review.js +54 -0
- package/target/main/ts/compose/schema-error.d.ts +2 -0
- package/target/main/ts/compose/schema-error.js +16 -0
- package/target/main/ts/compose/sources.d.ts +2 -0
- package/target/main/ts/compose/sources.js +32 -0
- package/target/main/ts/compose/structure-measures.d.ts +9 -0
- package/target/main/ts/compose/structure-measures.js +63 -0
- package/target/main/ts/index.d.ts +8 -0
- package/target/main/ts/index.js +5 -0
- package/target/main/ts/plugin.d.ts +2 -0
- package/target/main/ts/plugin.js +2 -0
- package/target/main/ts/plugins/built-in.d.ts +3 -0
- package/target/main/ts/plugins/built-in.js +19 -0
- package/target/main/ts/plugins/coverage/coverage.d.ts +11 -0
- package/target/main/ts/plugins/coverage/coverage.js +289 -0
- package/target/main/ts/plugins/coverage/diff-coverage.d.ts +3 -0
- package/target/main/ts/plugins/coverage/diff-coverage.js +85 -0
- package/target/main/ts/plugins/duplication/duplication.d.ts +2 -0
- package/target/main/ts/plugins/duplication/duplication.js +95 -0
- package/target/main/ts/plugins/language-js/babel-provider.d.ts +10 -0
- package/target/main/ts/plugins/language-js/babel-provider.js +54 -0
- package/target/main/ts/plugins/language-js/clone-candidates.d.ts +3 -0
- package/target/main/ts/plugins/language-js/clone-candidates.js +65 -0
- package/target/main/ts/plugins/language-js/code-lines.d.ts +6 -0
- package/target/main/ts/plugins/language-js/code-lines.js +36 -0
- package/target/main/ts/plugins/language-js/extensions.d.ts +1 -0
- package/target/main/ts/plugins/language-js/extensions.js +3 -0
- package/target/main/ts/plugins/language-js/function-facts.d.ts +9 -0
- package/target/main/ts/plugins/language-js/function-facts.js +74 -0
- package/target/main/ts/plugins/language-js/js-security.d.ts +4 -0
- package/target/main/ts/plugins/language-js/js-security.js +497 -0
- package/target/main/ts/plugins/language-js/qualified-names.d.ts +11 -0
- package/target/main/ts/plugins/language-js/qualified-names.js +63 -0
- package/target/main/ts/plugins/language-js/structural-observations.d.ts +9 -0
- package/target/main/ts/plugins/language-js/structural-observations.js +85 -0
- package/target/main/ts/plugins/language-js/syntax.d.ts +2 -0
- package/target/main/ts/plugins/language-js/syntax.js +11 -0
- package/target/main/ts/plugins/maintainability/maintainability.d.ts +2 -0
- package/target/main/ts/plugins/maintainability/maintainability.js +38 -0
- package/target/main/ts/plugins/maintainability/structural-smells.d.ts +3 -0
- package/target/main/ts/plugins/maintainability/structural-smells.js +17 -0
- package/target/main/ts/plugins/security/actions-security.d.ts +2 -0
- package/target/main/ts/plugins/security/actions-security.js +581 -0
- package/target/main/ts/plugins/security/dockerfile.d.ts +2 -0
- package/target/main/ts/plugins/security/dockerfile.js +487 -0
- package/target/main/ts/plugins/security/npm-supply-chain.d.ts +4 -0
- package/target/main/ts/plugins/security/npm-supply-chain.js +368 -0
- package/target/main/ts/plugins/security/secrets.d.ts +12 -0
- package/target/main/ts/plugins/security/secrets.js +254 -0
- package/target/main/ts/plugins/source/forges.d.ts +4 -0
- package/target/main/ts/plugins/source/forges.js +80 -0
- package/target/main/ts/plugins/structure/structure.d.ts +2 -0
- package/target/main/ts/plugins/structure/structure.js +42 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.js +59 -0
- package/target/main/ts/report/html/app/viewer-chart-label.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-chart-label.js +43 -0
- package/target/main/ts/report/html/app/viewer-chart-line.d.ts +33 -0
- package/target/main/ts/report/html/app/viewer-chart-line.js +88 -0
- package/target/main/ts/report/html/app/viewer-chart-points.d.ts +52 -0
- package/target/main/ts/report/html/app/viewer-chart-points.js +65 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.d.ts +21 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.js +93 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.d.ts +28 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.js +41 -0
- package/target/main/ts/report/html/app/viewer-chart-time.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-chart-time.js +150 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.js +210 -0
- package/target/main/ts/report/html/app/viewer-chart-x.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-chart-x.js +50 -0
- package/target/main/ts/report/html/app/viewer-chart.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-chart.js +50 -0
- package/target/main/ts/report/html/app/viewer-code-map.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-code-map.js +176 -0
- package/target/main/ts/report/html/app/viewer-columns.d.ts +40 -0
- package/target/main/ts/report/html/app/viewer-columns.js +97 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.js +229 -0
- package/target/main/ts/report/html/app/viewer-commits.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-commits.js +81 -0
- package/target/main/ts/report/html/app/viewer-controls.d.ts +43 -0
- package/target/main/ts/report/html/app/viewer-controls.js +141 -0
- package/target/main/ts/report/html/app/viewer-copy.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-copy.js +64 -0
- package/target/main/ts/report/html/app/viewer-data.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-data.js +78 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.js +60 -0
- package/target/main/ts/report/html/app/viewer-dom.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-dom.js +99 -0
- package/target/main/ts/report/html/app/viewer-file-aside.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-file-aside.js +134 -0
- package/target/main/ts/report/html/app/viewer-file-figures.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-file-figures.js +65 -0
- package/target/main/ts/report/html/app/viewer-file-source.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-file-source.js +119 -0
- package/target/main/ts/report/html/app/viewer-files.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-files.js +40 -0
- package/target/main/ts/report/html/app/viewer-filter.d.ts +65 -0
- package/target/main/ts/report/html/app/viewer-filter.js +161 -0
- package/target/main/ts/report/html/app/viewer-hotspots.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-hotspots.js +133 -0
- package/target/main/ts/report/html/app/viewer-inspection.d.ts +69 -0
- package/target/main/ts/report/html/app/viewer-inspection.js +38 -0
- package/target/main/ts/report/html/app/viewer-issue-group.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-issue-group.js +174 -0
- package/target/main/ts/report/html/app/viewer-issues.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-issues.js +173 -0
- package/target/main/ts/report/html/app/viewer-language-bar.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-language-bar.js +76 -0
- package/target/main/ts/report/html/app/viewer-languages.d.ts +35 -0
- package/target/main/ts/report/html/app/viewer-languages.js +97 -0
- package/target/main/ts/report/html/app/viewer-layout.d.ts +14 -0
- package/target/main/ts/report/html/app/viewer-layout.js +134 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.js +108 -0
- package/target/main/ts/report/html/app/viewer-locations.d.ts +16 -0
- package/target/main/ts/report/html/app/viewer-locations.js +31 -0
- package/target/main/ts/report/html/app/viewer-map-scale.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-map-scale.js +147 -0
- package/target/main/ts/report/html/app/viewer-map-shape.d.ts +42 -0
- package/target/main/ts/report/html/app/viewer-map-shape.js +102 -0
- package/target/main/ts/report/html/app/viewer-metric-format.d.ts +23 -0
- package/target/main/ts/report/html/app/viewer-metric-format.js +93 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.js +138 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.js +159 -0
- package/target/main/ts/report/html/app/viewer-metrics.d.ts +51 -0
- package/target/main/ts/report/html/app/viewer-metrics.js +195 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.js +121 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.d.ts +9 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.js +173 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.js +116 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.js +119 -0
- package/target/main/ts/report/html/app/viewer-profile-table.d.ts +29 -0
- package/target/main/ts/report/html/app/viewer-profile-table.js +124 -0
- package/target/main/ts/report/html/app/viewer-profile.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-profile.js +180 -0
- package/target/main/ts/report/html/app/viewer-projects.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer-projects.js +90 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.js +118 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.js +63 -0
- package/target/main/ts/report/html/app/viewer-pulls.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-pulls.js +92 -0
- package/target/main/ts/report/html/app/viewer-query-field.d.ts +19 -0
- package/target/main/ts/report/html/app/viewer-query-field.js +203 -0
- package/target/main/ts/report/html/app/viewer-route.d.ts +34 -0
- package/target/main/ts/report/html/app/viewer-route.js +55 -0
- package/target/main/ts/report/html/app/viewer-shell.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-shell.js +113 -0
- package/target/main/ts/report/html/app/viewer-source-view.d.ts +49 -0
- package/target/main/ts/report/html/app/viewer-source-view.js +150 -0
- package/target/main/ts/report/html/app/viewer-source.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-source.js +57 -0
- package/target/main/ts/report/html/app/viewer-suggest.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-suggest.js +91 -0
- package/target/main/ts/report/html/app/viewer-sunburst.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-sunburst.js +40 -0
- package/target/main/ts/report/html/app/viewer-table-cells.d.ts +25 -0
- package/target/main/ts/report/html/app/viewer-table-cells.js +135 -0
- package/target/main/ts/report/html/app/viewer-table-rows.d.ts +56 -0
- package/target/main/ts/report/html/app/viewer-table-rows.js +97 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.js +241 -0
- package/target/main/ts/report/html/app/viewer-totals.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-totals.js +100 -0
- package/target/main/ts/report/html/app/viewer-treemap.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-treemap.js +112 -0
- package/target/main/ts/report/html/app/viewer-trend-data.d.ts +54 -0
- package/target/main/ts/report/html/app/viewer-trend-data.js +109 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.js +86 -0
- package/target/main/ts/report/html/app/viewer-trend-points.d.ts +30 -0
- package/target/main/ts/report/html/app/viewer-trend-points.js +128 -0
- package/target/main/ts/report/html/app/viewer-trend-series.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-trend-series.js +128 -0
- package/target/main/ts/report/html/app/viewer-trends.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trends.js +89 -0
- package/target/main/ts/report/html/app/viewer.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer.js +222 -0
- package/target/main/ts/report/html/site/badges.d.ts +11 -0
- package/target/main/ts/report/html/site/badges.js +72 -0
- package/target/main/ts/report/html/site/export-site.d.ts +16 -0
- package/target/main/ts/report/html/site/export-site.js +129 -0
- package/target/main/ts/report/html/site/exported-server.d.ts +6 -0
- package/target/main/ts/report/html/site/exported-server.js +72 -0
- package/target/main/ts/report/html/site/local-server.d.ts +7 -0
- package/target/main/ts/report/html/site/local-server.js +59 -0
- package/target/main/ts/report/html/site/projects.d.ts +1 -0
- package/target/main/ts/report/html/site/projects.js +69 -0
- package/target/main/ts/report/html/site/server.d.ts +4 -0
- package/target/main/ts/report/html/site/server.js +65 -0
- package/target/main/ts/report/html/site/source-route.d.ts +6 -0
- package/target/main/ts/report/html/site/source-route.js +23 -0
- package/target/main/ts/report/json/projections/commit-summary.d.ts +13 -0
- package/target/main/ts/report/json/projections/commit-summary.js +126 -0
- package/target/main/ts/report/json/projections/components.d.ts +4 -0
- package/target/main/ts/report/json/projections/components.js +30 -0
- package/target/main/ts/report/json/projections/file-metrics.d.ts +4 -0
- package/target/main/ts/report/json/projections/file-metrics.js +260 -0
- package/target/main/ts/report/json/projections/ignore-view.d.ts +2 -0
- package/target/main/ts/report/json/projections/ignore-view.js +13 -0
- package/target/main/ts/report/json/projections/inspection-context.d.ts +5 -0
- package/target/main/ts/report/json/projections/inspection-context.js +104 -0
- package/target/main/ts/report/json/projections/inspection-details.d.ts +14 -0
- package/target/main/ts/report/json/projections/inspection-details.js +98 -0
- package/target/main/ts/report/json/projections/metric-values.d.ts +14 -0
- package/target/main/ts/report/json/projections/metric-values.js +104 -0
- package/target/main/ts/report/json/projections/profile-selectors.d.ts +8 -0
- package/target/main/ts/report/json/projections/profile-selectors.js +34 -0
- package/target/main/ts/report/json/projections/security-summary.d.ts +11 -0
- package/target/main/ts/report/json/projections/security-summary.js +22 -0
- package/target/main/ts/report/json/store/directory.d.ts +3 -0
- package/target/main/ts/report/json/store/directory.js +19 -0
- package/target/main/ts/report/json/store/local-store.d.ts +25 -0
- package/target/main/ts/report/json/store/local-store.js +214 -0
- package/target/main/ts/report/json/store/object-store.d.ts +14 -0
- package/target/main/ts/report/json/store/object-store.js +73 -0
- package/target/main/ts/report/json/store/operation-cache.d.ts +8 -0
- package/target/main/ts/report/json/store/operation-cache.js +32 -0
- package/target/main/ts/report/json/store/pull-review-store.d.ts +2 -0
- package/target/main/ts/report/json/store/pull-review-store.js +33 -0
- package/target/main/ts/report/json/store/replace-file.d.ts +1 -0
- package/target/main/ts/report/json/store/replace-file.js +35 -0
- package/target/main/ts/report/json/store/report-tree.d.ts +46 -0
- package/target/main/ts/report/json/store/report-tree.js +295 -0
- package/target/main/ts/report/json/store/store-check.d.ts +32 -0
- package/target/main/ts/report/json/store/store-check.js +153 -0
- package/target/main/ts/report/json/validation/metabranch.d.ts +4 -0
- package/target/main/ts/report/json/validation/metabranch.js +11 -0
- package/target/main/ts/report/json/validation/report.d.ts +20 -0
- package/target/main/ts/report/json/validation/report.js +82 -0
- package/target/main/ts/report/json/validation/summary-validation.d.ts +4 -0
- package/target/main/ts/report/json/validation/summary-validation.js +30 -0
- package/target/main/ts/report/json/wire/compact-json.d.ts +11 -0
- package/target/main/ts/report/json/wire/compact-json.js +76 -0
- package/target/main/ts/report/json/wire/component-model.d.ts +9 -0
- package/target/main/ts/report/json/wire/component-model.js +1 -0
- package/target/main/ts/report/json/wire/domain-types.d.ts +2 -0
- package/target/main/ts/report/json/wire/domain-types.js +1 -0
- package/target/main/ts/report/json/wire/file-metrics-model.d.ts +81 -0
- package/target/main/ts/report/json/wire/file-metrics-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-context-model.d.ts +31 -0
- package/target/main/ts/report/json/wire/inspection-context-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-details-model.d.ts +87 -0
- package/target/main/ts/report/json/wire/inspection-details-model.js +1 -0
- package/target/main/ts/report/json/wire/project-model.d.ts +7 -0
- package/target/main/ts/report/json/wire/project-model.js +1 -0
- package/target/main/ts/report/json/wire/public-history-model.d.ts +37 -0
- package/target/main/ts/report/json/wire/public-history-model.js +5 -0
- package/target/main/ts/report/json/wire/pull-review-model.d.ts +54 -0
- package/target/main/ts/report/json/wire/pull-review-model.js +3 -0
- package/target/main/ts/report/json/wire/summary-model.d.ts +45 -0
- package/target/main/ts/report/json/wire/summary-model.js +1 -0
- package/target/main/ts/report/markdown/pull-review.d.ts +5 -0
- package/target/main/ts/report/markdown/pull-review.js +132 -0
- package/target/main/ts/report.d.ts +23 -0
- package/target/main/ts/report.js +12 -0
- package/target/main/ts/runtime.d.ts +17 -0
- package/target/main/ts/runtime.js +30 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { isRecord } from '@repometry/core/internal/engine/plugin.js';
|
|
2
|
+
import { ReportProducts } from '@repometry/core/internal/engine/report-products.js';
|
|
3
|
+
import { codeStructure, recoveredSyntax } from '@repometry/core/internal/model/code-structure.js';
|
|
4
|
+
import { recoveredSourceOperation } from '@repometry/core/internal/model/report.js';
|
|
5
|
+
export class AnalysisResults {
|
|
6
|
+
measurements = [];
|
|
7
|
+
findings = [];
|
|
8
|
+
diagnostics;
|
|
9
|
+
parsed = new Set();
|
|
10
|
+
recovered = new Map();
|
|
11
|
+
ran = new Set();
|
|
12
|
+
ruleSkips = [];
|
|
13
|
+
unmeasured = new Map();
|
|
14
|
+
inspected = new Set();
|
|
15
|
+
completedInspection = false;
|
|
16
|
+
products;
|
|
17
|
+
scanned = new Set();
|
|
18
|
+
scanOnly;
|
|
19
|
+
securityOperations;
|
|
20
|
+
recoveryOperations;
|
|
21
|
+
usedPlans = new Map();
|
|
22
|
+
constructor(plugins, oversized) {
|
|
23
|
+
this.products = new ReportProducts(plugins);
|
|
24
|
+
this.diagnostics = oversized.map(oversizedClaim);
|
|
25
|
+
this.recoveryOperations = new Set(plugins.filter(plugin => plugin.languageProvenanceRequiresSource && plugin.kinds.includes('language')).flatMap(({ id, operations }) => operations.filter(operation => operation.role === 'provider' && operation.output.id === codeStructure.id)
|
|
26
|
+
.map(operation => id + '/' + operation.id)));
|
|
27
|
+
this.scanOnly = new Set(plugins.filter(plugin => plugin.claims?.scanOnly).flatMap(({ id, operations }) => operations.map(operation => `${id}/${operation.id}`)));
|
|
28
|
+
this.securityOperations = new Map(plugins.filter(plugin => plugin.kinds.includes('security')).flatMap(plugin => plugin.operations.filter(({ role }) => role === 'inspection').map(({ id }) => [`${plugin.id}/${id}`, plugin.id])));
|
|
29
|
+
}
|
|
30
|
+
remember(task, syntaxProvider) {
|
|
31
|
+
this.usedPlans.set(JSON.stringify([task.key, [...task.inputs], syntaxProvider]), operationProvenance(task, syntaxProvider));
|
|
32
|
+
}
|
|
33
|
+
operationRecords() {
|
|
34
|
+
return [...this.usedPlans.values()];
|
|
35
|
+
}
|
|
36
|
+
pluginData() {
|
|
37
|
+
return this.products.result();
|
|
38
|
+
}
|
|
39
|
+
securityScanners(plugins) {
|
|
40
|
+
return plugins.filter(plugin => this.scanned.has(plugin.id)).map(({ id, version }) => ({ name: id, version }));
|
|
41
|
+
}
|
|
42
|
+
record(task, outcome, path, paths) {
|
|
43
|
+
if (outcome.state !== 'blocked')
|
|
44
|
+
this.ran.add(task.key);
|
|
45
|
+
if (outcome.state !== 'completed') {
|
|
46
|
+
this.diagnostics.push({ operation: task.key, state: outcome.state, message: outcome.reason,
|
|
47
|
+
...(path === undefined ? {} : { path }) });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const stored = this.products.record(task, outcome.product, path);
|
|
52
|
+
this.recordRecovery(task, outcome.product.value, path);
|
|
53
|
+
this.recordInspection(task, outcome.diagnostics ?? [], path, paths);
|
|
54
|
+
if (stored) {
|
|
55
|
+
for (const measurement of stored.measurements)
|
|
56
|
+
this.measurements.push(measurement);
|
|
57
|
+
for (const finding of stored.findings)
|
|
58
|
+
this.findings.push(finding);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
this.diagnostics.push({ operation: task.key, state: 'failed', path, message: error instanceof Error ? error.message : String(error) });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
hasBlockingDiagnostics() {
|
|
66
|
+
return this.diagnostics.some(row => row.path === undefined || this.recovered.get(row.path) !== row);
|
|
67
|
+
}
|
|
68
|
+
recordRecovery(task, value, path) {
|
|
69
|
+
if (path === undefined || this.recovered.has(path) || !this.recoveryOperations.has(task.key))
|
|
70
|
+
return;
|
|
71
|
+
const facts = value;
|
|
72
|
+
const details = recoveryDetails(facts[recoveredSyntax]);
|
|
73
|
+
if (details === undefined)
|
|
74
|
+
return;
|
|
75
|
+
const message = details.reason + ' at ' + details.location + '. Declarations omitted: ' + details.omitted + '.';
|
|
76
|
+
const measured = (facts.functions ?? 0) + (facts.classes ?? 0);
|
|
77
|
+
const diagnostic = { operation: recoveredSourceOperation, state: 'partial', path,
|
|
78
|
+
message: measured ? message : message + ' No declarations could be measured.' };
|
|
79
|
+
this.recovered.set(path, diagnostic);
|
|
80
|
+
this.diagnostics.push(diagnostic);
|
|
81
|
+
}
|
|
82
|
+
recordInspection(task, messages, path, paths) {
|
|
83
|
+
for (const { message, path: own = path } of messages)
|
|
84
|
+
this.diagnostics.push({ operation: task.key, state: 'partial', ...(own === undefined ? {} : { path: own }), message });
|
|
85
|
+
const scanner = this.securityOperations.get(task.key);
|
|
86
|
+
if (scanner)
|
|
87
|
+
this.scanned.add(scanner);
|
|
88
|
+
if (task.operation.role !== 'inspection' || (path === undefined && !paths?.length))
|
|
89
|
+
return;
|
|
90
|
+
this.completedInspection = true;
|
|
91
|
+
if (this.scanOnly.has(task.key))
|
|
92
|
+
return;
|
|
93
|
+
if (path !== undefined)
|
|
94
|
+
this.inspected.add(path);
|
|
95
|
+
else
|
|
96
|
+
for (const file of paths ?? [])
|
|
97
|
+
this.inspected.add(file);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function recoveryDetails(value) {
|
|
101
|
+
if (!isRecord(value))
|
|
102
|
+
return undefined;
|
|
103
|
+
const { reason, location, omitted } = value;
|
|
104
|
+
if (typeof reason !== 'string' || !reason.trim()
|
|
105
|
+
|| typeof location !== 'string' || !/^line [1-9]\d*, column [1-9]\d*$/.test(location)
|
|
106
|
+
|| typeof omitted !== 'number' || !Number.isSafeInteger(omitted) || omitted < 0)
|
|
107
|
+
return undefined;
|
|
108
|
+
return { reason, location, omitted };
|
|
109
|
+
}
|
|
110
|
+
export function operationProvenance(task, syntaxProvider) {
|
|
111
|
+
return { key: task.key, inputs: Object.fromEntries(task.inputs),
|
|
112
|
+
...(task.operation.implementation === undefined ? {} : { implementation: task.operation.implementation }),
|
|
113
|
+
...(task.operation.scope === 'repository' ? { scope: task.operation.scope } : {}),
|
|
114
|
+
...(syntaxProvider === undefined ? {} : { syntaxProvider }) };
|
|
115
|
+
}
|
|
116
|
+
export function oversizedClaim(path) {
|
|
117
|
+
return { operation: 'source/claims', state: 'partial', path, message: 'Plugin inspection skipped a file larger than 1 MiB' };
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=analysis-results.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OperationCacheOptions } from '@repometry/core/internal/engine/operation-cache.js';
|
|
2
|
+
import type { PlannedOperation } from '@repometry/core/internal/engine/plan.js';
|
|
3
|
+
import type { CodeStructure } from '@repometry/core/internal/model/code-structure.js';
|
|
4
|
+
import type { AnalysisInput } from '@repometry/core/internal/usecases/inspect.js';
|
|
5
|
+
import type { AnalysisResults } from './analysis-results.js';
|
|
6
|
+
import type { HistoryFiles } from './history-cache.js';
|
|
7
|
+
import type { AnalysisSources } from './phases.js';
|
|
8
|
+
/** A parsed file's structure, kept for the inspections after the files, and the plugin that parsed it. */
|
|
9
|
+
export type ParsedFile = Readonly<{
|
|
10
|
+
path: string;
|
|
11
|
+
structure: CodeStructure;
|
|
12
|
+
parser: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** The plan of a file the first provider parses and nothing claims, recorded before any file so the records keep their order. */
|
|
15
|
+
export declare function defaultFilePlan(sources: AnalysisSources): readonly PlannedOperation[];
|
|
16
|
+
/** Runs each language parsed over the repository on its files, with the plugin's other repository operations. */
|
|
17
|
+
export declare function collectRepositorySyntax(sources: AnalysisSources, results: AnalysisResults, cache?: OperationCacheOptions, history?: HistoryFiles): Promise<Map<string, CodeStructure>>;
|
|
18
|
+
/** Runs each file's inspections, with its provider's parse unless the repository syntax already read the file. */
|
|
19
|
+
export declare function inspectFiles(sources: AnalysisSources, batchFacts: ReadonlyMap<string, CodeStructure>, results: AnalysisResults, cache?: OperationCacheOptions, history?: HistoryFiles): Promise<ParsedFile[]>;
|
|
20
|
+
/** Runs every other repository inspection on the files its plugin claims. */
|
|
21
|
+
export declare function inspectRepositories(sources: AnalysisSources, results: AnalysisResults, cache?: OperationCacheOptions): Promise<void>;
|
|
22
|
+
/** Runs the inspections that read what the files phase gathered: clone sources and, when given, the coverage input. */
|
|
23
|
+
export declare function inspectAfterFiles({ coverage: input, excludedPaths, snapshot, ignoresCoverage }: AnalysisInput, sources: AnalysisSources, parsed: readonly ParsedFile[], results: AnalysisResults, cache?: OperationCacheOptions): Promise<void>;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { execute } from '@repometry/core/internal/engine/execute.js';
|
|
2
|
+
import { plan } from '@repometry/core/internal/engine/plan.js';
|
|
3
|
+
import { cloneSources as cloneSourcesContract } from '@repometry/core/internal/model/clone-source.js';
|
|
4
|
+
import { codeStructure, codeStructures, ruleCategoryMeasures, structureCodeLines } from '@repometry/core/internal/model/code-structure.js';
|
|
5
|
+
import { lcovInput } from '@repometry/core/internal/model/coverage-input.js';
|
|
6
|
+
import { sourceFile, sourceFiles, sourceLineCounts } from '@repometry/core/internal/model/snapshot.js';
|
|
7
|
+
import { isClaimedText, maxClaimedFileBytes } from '@repometry/core/internal/model/source.js';
|
|
8
|
+
import { sourceExclusionMatcher } from '@repometry/core/internal/profile/exclusions.js';
|
|
9
|
+
import { oversizedClaim } from './analysis-results.js';
|
|
10
|
+
import { canReuseBatch } from './history-cache.js';
|
|
11
|
+
import { analysisPhases, phaseInputs } from './phases.js';
|
|
12
|
+
import { unmeasuredStructure } from './structure-measures.js';
|
|
13
|
+
// The steps of an analysis in run order. Each runs what the phases chose for it; none decides what runs where.
|
|
14
|
+
const { files: filesPhase, repository: repositoryPhase } = analysisPhases(false);
|
|
15
|
+
/** The plan of a file the first provider parses and nothing claims, recorded before any file so the records keep their order. */
|
|
16
|
+
export function defaultFilePlan(sources) {
|
|
17
|
+
const [provider] = sources.languages.providers;
|
|
18
|
+
if (!provider || !sources.sources.some(source => source.provider === provider))
|
|
19
|
+
return [];
|
|
20
|
+
// Language plugins claim the files they parse, so only the first provider's plugin and those without claims are left.
|
|
21
|
+
const unclaimed = ({ claims, providesLanguages, id }) => (!claims && !providesLanguages) || id === provider?.plugin.id;
|
|
22
|
+
return filePlan(provider, sources.steps.files.inspections.filter(({ parsed, plugin }) => parsed && unclaimed(plugin)), sources.steps.files.candidates.filter(unclaimed));
|
|
23
|
+
}
|
|
24
|
+
/** Runs each language parsed over the repository on its files, with the plugin's other repository operations. */
|
|
25
|
+
export async function collectRepositorySyntax(sources, results, cache, history) {
|
|
26
|
+
const facts = new Map();
|
|
27
|
+
for (const { provider, ...step } of sources.steps.repositorySyntax) {
|
|
28
|
+
const files = sources.sources.filter(source => source.provider === provider).map(({ file }) => file);
|
|
29
|
+
if (!files.length)
|
|
30
|
+
continue;
|
|
31
|
+
const reusable = canReuseBatch(provider) ? history : undefined;
|
|
32
|
+
const outcomes = await runRepository(step, files, [provider.key, ...step.inspections.map(({ key }) => key)], results, cache, reusable);
|
|
33
|
+
const syntax = outcomes.get(provider.key); // execute() checked its value against the contract
|
|
34
|
+
if (syntax?.state === 'completed')
|
|
35
|
+
collectFacts(facts, syntax.product.value, files, provider.key, results);
|
|
36
|
+
}
|
|
37
|
+
return facts;
|
|
38
|
+
}
|
|
39
|
+
/** Runs each file's inspections, with its provider's parse unless the repository syntax already read the file. */
|
|
40
|
+
export async function inspectFiles(sources, batchFacts, results, cache, history) {
|
|
41
|
+
const plans = new Map();
|
|
42
|
+
const parsed = [];
|
|
43
|
+
for (const source of sources.sources) {
|
|
44
|
+
const { file, provider } = source;
|
|
45
|
+
const inspections = fileInspections(source, sources.steps.files, results);
|
|
46
|
+
if (!provider && !inspections.length)
|
|
47
|
+
continue;
|
|
48
|
+
const tasks = findFilePlan(sources, source, inspections, plans, results);
|
|
49
|
+
const facts = batchFacts.get(file.path);
|
|
50
|
+
const reusable = provider?.batch && (!facts || !canReuseBatch(provider)) ? undefined : history;
|
|
51
|
+
const outcomes = await fileOutcomes(source, tasks, facts, cache, reusable);
|
|
52
|
+
const structure = facts ?? parsedStructure(provider && outcomes.get(provider.key));
|
|
53
|
+
if (structure)
|
|
54
|
+
parsed.push(recordParsed({ path: file.path, structure, parser: provider.plugin.id }, results, sources.plugins));
|
|
55
|
+
for (const task of tasks)
|
|
56
|
+
results.record(task, outcomes.get(task.key), file.path);
|
|
57
|
+
}
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
/** Runs every other repository inspection on the files its plugin claims. */
|
|
61
|
+
export async function inspectRepositories(sources, results, cache) {
|
|
62
|
+
const step = sources.steps.repository;
|
|
63
|
+
for (const plugin of new Set(step.inspections.map(({ plugin }) => plugin))) {
|
|
64
|
+
const inspections = step.inspections.filter(inspection => inspection.plugin === plugin);
|
|
65
|
+
const files = sources.sources.map(({ file }) => file).filter(file => inspections[0].matches(file.path, false) && isClaimedText(file.bytes));
|
|
66
|
+
if (files.length)
|
|
67
|
+
await runRepository(step, files, inspections.map(({ key }) => key), results, cache);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Runs the inspections that read what the files phase gathered: clone sources and, when given, the coverage input. */
|
|
71
|
+
export async function inspectAfterFiles({ coverage: input, excludedPaths = [], snapshot, ignoresCoverage }, sources, parsed, results, cache) {
|
|
72
|
+
const clones = parsed.flatMap(({ structure: { clones }, parser }) => clones ? [{ ...clones, scheme: clones.scheme ?? parser }] : []);
|
|
73
|
+
const products = new Map([['sources', { contract: cloneSourcesContract.id, value: clones }]]);
|
|
74
|
+
if (input !== undefined) {
|
|
75
|
+
const unclassified = new Set([...results.unmeasured].filter(([, missing]) => missing.includes('codeLines')).map(([path]) => path));
|
|
76
|
+
const excludes = sourceExclusionMatcher(excludedPaths, snapshot.generatedExcluded);
|
|
77
|
+
const codeLines = parsed.flatMap(({ path, structure }) => {
|
|
78
|
+
const lines = structureCodeLines(structure);
|
|
79
|
+
return lines === undefined ? [] : [[path, new Set(lines)]];
|
|
80
|
+
});
|
|
81
|
+
const functionBodies = parsed.flatMap(({ path, structure: { functionBodies } }) => functionBodies ? [[path, functionBodies]] : []);
|
|
82
|
+
products.set('lcov', { contract: lcovInput.id, value: { text: input.text, root: input.sourceRoot,
|
|
83
|
+
sourceLines: sourceLineCounts(sources.sourceFiles), codeLines: new Map(codeLines), unclassified,
|
|
84
|
+
functionBodies: new Map(functionBodies), excludes: (path) => excludes(path) || ignoresCoverage?.(path) === true || sources.unavailableFiles.has(path) } });
|
|
85
|
+
}
|
|
86
|
+
const { candidates, inspections } = sources.steps.afterFiles;
|
|
87
|
+
const tasks = plan({ plugins: candidates, select: inspections.map(({ key }) => key),
|
|
88
|
+
inputs: new Map([...products].map(([port, { contract }]) => [port, contract])) });
|
|
89
|
+
const outcomes = await execute(tasks, products, cache);
|
|
90
|
+
for (const task of tasks) {
|
|
91
|
+
results.remember(task);
|
|
92
|
+
results.record(task, outcomes.get(task.key));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function parsedStructure(outcome) {
|
|
96
|
+
return outcome?.state === 'completed' ? outcome.product.value : undefined; // execute() checked the contract
|
|
97
|
+
}
|
|
98
|
+
async function fileOutcomes({ file }, tasks, facts, cache, history) {
|
|
99
|
+
const saved = history?.read(file.path)?.outcomes;
|
|
100
|
+
if (saved) {
|
|
101
|
+
history?.retain(file.path, { outcomes: saved });
|
|
102
|
+
return saved;
|
|
103
|
+
}
|
|
104
|
+
const products = new Map([['file', { contract: sourceFile.id, value: file }]]);
|
|
105
|
+
if (facts)
|
|
106
|
+
products.set('syntax', { contract: codeStructure.id, value: facts });
|
|
107
|
+
const outcomes = await execute(tasks, products, cache);
|
|
108
|
+
if (history && [...outcomes.values()].every(outcome => outcome.state === 'completed' && !outcome.diagnostics?.length)) {
|
|
109
|
+
history.retain(file.path, { outcomes });
|
|
110
|
+
}
|
|
111
|
+
return outcomes;
|
|
112
|
+
}
|
|
113
|
+
/** The inspections that run on a file. Those that run because their plugin claims it need a text file under the size limit. */
|
|
114
|
+
function fileInspections({ file, provider }, { inspections }, results) {
|
|
115
|
+
const matched = inspections.filter(({ matches }) => matches(file.path, provider !== undefined));
|
|
116
|
+
const claimed = matched.some(({ parsed }) => !parsed);
|
|
117
|
+
if (claimed && file.bytes.byteLength > maxClaimedFileBytes)
|
|
118
|
+
results.diagnostics.push(oversizedClaim(file.path));
|
|
119
|
+
return isClaimedText(file.bytes) ? matched : matched.filter(({ parsed }) => parsed);
|
|
120
|
+
}
|
|
121
|
+
/** A file's plan, shared by the files with the same provider, inspections and claiming plugins. */
|
|
122
|
+
function findFilePlan(sources, { file, provider }, inspections, plans, results) {
|
|
123
|
+
// A consumer runs only where its producer may: the planner chooses from the plugins that claim the file.
|
|
124
|
+
const claiming = sources.steps.files.candidates.filter(plugin => sources.steps.claims(plugin, file.path));
|
|
125
|
+
const key = JSON.stringify([provider?.key ?? null, inspections.map(({ key }) => key), claiming.map(({ id }) => id)]);
|
|
126
|
+
const cached = plans.get(key);
|
|
127
|
+
if (cached)
|
|
128
|
+
return cached;
|
|
129
|
+
const tasks = filePlan(provider, inspections, claiming);
|
|
130
|
+
plans.set(key, tasks);
|
|
131
|
+
for (const task of tasks) {
|
|
132
|
+
const consumesBatch = provider?.batch && [...task.inputs.values()].some(input => 'external' in input && input.external === 'syntax');
|
|
133
|
+
results.remember(task, consumesBatch ? provider.key : undefined);
|
|
134
|
+
}
|
|
135
|
+
return tasks;
|
|
136
|
+
}
|
|
137
|
+
/** A file's plan: its provider's parse unless the repository syntax already read it, then the file's inspections. */
|
|
138
|
+
function filePlan(provider, inspections, plugins) {
|
|
139
|
+
const parse = provider && !provider.batch ? [provider.key] : [];
|
|
140
|
+
return plan({ plugins, select: [...parse, ...inspections.map(({ key }) => key)],
|
|
141
|
+
inputs: phaseInputs(filesPhase, provider?.batch ? undefined : codeStructure) });
|
|
142
|
+
}
|
|
143
|
+
/** Records a parsed file and, for each measure it lacks, a skip of the rules that need the measure. */
|
|
144
|
+
function recordParsed(file, results, plugins) {
|
|
145
|
+
const { path } = file;
|
|
146
|
+
results.parsed.add(path);
|
|
147
|
+
const unmeasured = unmeasuredStructure(file.structure);
|
|
148
|
+
if (unmeasured.length)
|
|
149
|
+
results.unmeasured.set(path, unmeasured);
|
|
150
|
+
for (const plugin of plugins) {
|
|
151
|
+
const rules = plugin.rules?.filter(({ category }) => unmeasured.some(measure => ruleCategoryMeasures[category] === measure))
|
|
152
|
+
.map(({ id }) => id) ?? [];
|
|
153
|
+
if (rules.length)
|
|
154
|
+
results.ruleSkips.push({ path, plugin: plugin.id, rules, reason: 'unmeasured' });
|
|
155
|
+
}
|
|
156
|
+
return file;
|
|
157
|
+
}
|
|
158
|
+
async function runRepository({ candidates }, files, select, results, cache, history) {
|
|
159
|
+
const tasks = plan({ plugins: candidates, select, inputs: phaseInputs(repositoryPhase) });
|
|
160
|
+
const outcomes = history && tasks.length === 1
|
|
161
|
+
? await runIndependentProvider(tasks[0], files, history, cache) : await executeRepository(tasks, files, cache);
|
|
162
|
+
const paths = files.map(({ path }) => path);
|
|
163
|
+
for (const task of tasks) {
|
|
164
|
+
results.remember(task);
|
|
165
|
+
results.record(task, outcomes.get(task.key), undefined, paths);
|
|
166
|
+
}
|
|
167
|
+
return outcomes;
|
|
168
|
+
}
|
|
169
|
+
function executeRepository(tasks, files, cache) {
|
|
170
|
+
return execute(tasks, new Map([['files', { contract: sourceFiles.id, value: files }]]), cache);
|
|
171
|
+
}
|
|
172
|
+
async function runIndependentProvider(task, files, history, cache) {
|
|
173
|
+
const saved = new Map(files.flatMap(({ path }) => {
|
|
174
|
+
const syntax = history.read(path)?.syntax;
|
|
175
|
+
return syntax === undefined ? [] : [[path, syntax]];
|
|
176
|
+
}));
|
|
177
|
+
const missing = files.filter(({ path }) => !saved.has(path));
|
|
178
|
+
const outcomes = missing.length === 0 ? undefined : await executeRepository([task], missing, cache);
|
|
179
|
+
const fresh = outcomes === undefined ? [] : successfulBatch(outcomes.get(task.key), missing);
|
|
180
|
+
// Preserve complete-batch diagnostics if an incremental run produces incomplete facts or a warning.
|
|
181
|
+
if (!fresh)
|
|
182
|
+
return saved.size ? executeRepository([task], files, cache) : outcomes;
|
|
183
|
+
for (const syntax of fresh)
|
|
184
|
+
saved.set(syntax.path, syntax);
|
|
185
|
+
const values = files.map(({ path }) => saved.get(path));
|
|
186
|
+
const { output } = task.operation;
|
|
187
|
+
if (missing.length !== files.length && (!output.accepts(values) || (task.validateOutput && !task.validateOutput(values)))) {
|
|
188
|
+
return executeRepository([task], files, cache);
|
|
189
|
+
}
|
|
190
|
+
for (const syntax of values)
|
|
191
|
+
history.retain(syntax.path, { syntax });
|
|
192
|
+
return missing.length === files.length ? outcomes : new Map([[task.key, {
|
|
193
|
+
state: 'completed', product: { contract: output.id, value: values },
|
|
194
|
+
}]]);
|
|
195
|
+
}
|
|
196
|
+
function successfulBatch(outcome, files) {
|
|
197
|
+
if (outcome?.state !== 'completed' || outcome.diagnostics?.length || !codeStructures.accepts(outcome.product.value))
|
|
198
|
+
return;
|
|
199
|
+
const values = outcome.product.value;
|
|
200
|
+
const paths = new Set(files.map(({ path }) => path));
|
|
201
|
+
if (values.length === paths.size && values.every(({ path }) => paths.has(path)))
|
|
202
|
+
return values;
|
|
203
|
+
}
|
|
204
|
+
function collectFacts(target, values, files, operation, results) {
|
|
205
|
+
const planned = new Set(files.map(({ path }) => path));
|
|
206
|
+
if (values.some(({ path }) => !planned.has(path))) {
|
|
207
|
+
results.diagnostics.push({ operation, state: 'failed', message: 'Language provider returned a path outside its inputs' });
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
for (const facts of values)
|
|
211
|
+
target.set(facts.path, facts);
|
|
212
|
+
for (const path of planned) {
|
|
213
|
+
if (!target.has(path))
|
|
214
|
+
results.diagnostics.push({ operation, state: 'failed', path, message: 'Language provider returned no structure for this file' });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=analysis-steps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OperationCacheOptions } from '@repometry/core/internal/engine/operation-cache.js';
|
|
2
|
+
import type { Report } from '@repometry/core/internal/model/report.js';
|
|
3
|
+
import type { AnalysisInput } from '@repometry/core/internal/usecases/inspect.js';
|
|
4
|
+
import type { HistoryCache } from './history-cache.js';
|
|
5
|
+
import type { LanguageRegistry } from './languages.js';
|
|
6
|
+
export { inspectionFileMatcher } from './phases.js';
|
|
7
|
+
export declare function analyzeSnapshot(input: AnalysisInput, languages: LanguageRegistry, cache?: OperationCacheOptions, history?: HistoryCache): Promise<Report>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { collectRepositorySyntax, defaultFilePlan, inspectAfterFiles, inspectFiles, inspectRepositories } from './analysis-steps.js';
|
|
2
|
+
import { assembleAnalysisReport } from './analysis-report.js';
|
|
3
|
+
import { AnalysisResults } from './analysis-results.js';
|
|
4
|
+
import { selectAnalysisSources } from './phases.js';
|
|
5
|
+
import { historyProfile } from './history-cache.js';
|
|
6
|
+
import { pluginScope } from './plugin-scope.js';
|
|
7
|
+
export { inspectionFileMatcher } from './phases.js';
|
|
8
|
+
export async function analyzeSnapshot(input, languages, cache, history) {
|
|
9
|
+
const sources = selectAnalysisSources(input.snapshot, input.coverage !== undefined, languages);
|
|
10
|
+
const reusable = history?.begin(input.snapshot, historyProfile(input, sources, cache?.configurationDigest));
|
|
11
|
+
const results = new AnalysisResults(sources.plugins, input.snapshot.oversizedClaims ?? []);
|
|
12
|
+
const defaults = languages.plugins.some(pluginScope) ? [] : defaultFilePlan(sources);
|
|
13
|
+
for (const task of defaults)
|
|
14
|
+
results.remember(task);
|
|
15
|
+
const batchFacts = await collectRepositorySyntax(sources, results, cache, reusable);
|
|
16
|
+
const parsed = await inspectFiles(sources, batchFacts, results, cache, reusable);
|
|
17
|
+
await inspectRepositories(sources, results, cache);
|
|
18
|
+
await inspectAfterFiles(input, sources, parsed, results, cache);
|
|
19
|
+
return assembleAnalysisReport(input, sources, results);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=analyze-snapshot.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { definitions } from '@repometry/core/internal/model/measurement.js';
|
|
2
|
+
import { reportSchema } from '../report/json/validation/report.js';
|
|
3
|
+
import { gitText } from '../api/git/git.js';
|
|
4
|
+
import { churnSettings, gitChurn } from '../api/git/git-churn.js';
|
|
5
|
+
export async function attachChurn(report, root, paths) {
|
|
6
|
+
if (report.subject.kind !== 'commit')
|
|
7
|
+
return report;
|
|
8
|
+
return withCommitDetails(await measureChurn(report, root, paths), root);
|
|
9
|
+
}
|
|
10
|
+
async function measureChurn(report, root, paths) {
|
|
11
|
+
if (paths.length === 0)
|
|
12
|
+
return withCommitTime(report, root);
|
|
13
|
+
const { churnWindow, ...appliedConfig } = report.appliedConfig;
|
|
14
|
+
const settings = { ...appliedConfig, churn: churnSettings };
|
|
15
|
+
const measurements = report.measurements.filter(row => row.definition !== definitions.churn);
|
|
16
|
+
const diagnostics = report.diagnostics.filter(row => row.operation !== 'git/churn');
|
|
17
|
+
try {
|
|
18
|
+
const churn = await gitChurn(root, report.subject.id, paths);
|
|
19
|
+
const rows = [...churn.touches].map(([path, value]) => ({ definition: definitions.churn, target: 'file', path, value }));
|
|
20
|
+
const status = report.status === 'partial' && diagnostics.length === 0 && report.diagnostics.length > 0 ? 'complete' : report.status;
|
|
21
|
+
return {
|
|
22
|
+
...report,
|
|
23
|
+
appliedConfig: { ...settings, churnWindow: churn.window },
|
|
24
|
+
definitions: { ...report.definitions, [definitions.churn]: 'First-parent commits that touched the current path, in the 90 days ending at the inspected commit. Root snapshots are omitted and renames start a new path.' },
|
|
25
|
+
status,
|
|
26
|
+
measurements: [...measurements, ...rows],
|
|
27
|
+
diagnostics,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return withCommitTime({ ...report, appliedConfig: settings, status: 'partial', measurements, diagnostics: [...diagnostics,
|
|
32
|
+
{ operation: 'git/churn', state: 'partial', message: 'Could not measure changes in the Git history available locally.' }] }, root);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function withCommitTime(report, root) {
|
|
36
|
+
const timestamp = await gitText(root, ['show', '--no-show-signature', '--no-notes', '--no-patch', '--format=%cI', report.subject.id, '--'])
|
|
37
|
+
.catch(() => '');
|
|
38
|
+
const time = Date.parse(timestamp.trim());
|
|
39
|
+
return Number.isFinite(time) ? { ...report, schema: reportSchema, committedAt: new Date(time).toISOString() } : report;
|
|
40
|
+
}
|
|
41
|
+
/** Message title and author of the inspected commit, kept with the inspection so exports need no Git history. */
|
|
42
|
+
async function withCommitDetails(report, root) {
|
|
43
|
+
const log = await gitText(root, ['show', '--no-show-signature', '--no-notes', '--no-patch', '--format=%an%x00%ae%x00%B', report.subject.id, '--'])
|
|
44
|
+
.catch(() => '');
|
|
45
|
+
const [name, email, message] = log.split('\0');
|
|
46
|
+
if (!name || email === undefined || message === undefined)
|
|
47
|
+
return report;
|
|
48
|
+
return { ...report, schema: reportSchema, commit: { subject: message.split(/\r?\n/, 1)[0], author: { name, email } } };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=attach-churn.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Plugin } from '@repometry/core/internal/engine/plugin.js';
|
|
2
|
+
import { builtInPlugins } from '../plugins/built-in.js';
|
|
3
|
+
export { builtInPlugins };
|
|
4
|
+
export declare const builtInPluginIds: ReadonlySet<string>;
|
|
5
|
+
/** Configured built-ins replace their defaults in registration order. */
|
|
6
|
+
export declare function registeredPlugins(additional: readonly Plugin[]): readonly Plugin[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pluginRegistration } from './registered-plugin.js';
|
|
2
|
+
import { builtInPlugins } from '../plugins/built-in.js';
|
|
3
|
+
// The one edge from compose to plugins: everything else in compose reads the built-ins from here.
|
|
4
|
+
export { builtInPlugins };
|
|
5
|
+
export const builtInPluginIds = new Set(builtInPlugins.map(({ id }) => id));
|
|
6
|
+
/** Configured built-ins replace their defaults in registration order. */
|
|
7
|
+
export function registeredPlugins(additional) {
|
|
8
|
+
const overrides = new Map(additional.filter(plugin => pluginRegistration(plugin)?.builtIn).map(plugin => [plugin.id, plugin]));
|
|
9
|
+
const builtIns = builtInPlugins.filter(plugin => !additional.includes(plugin)).map(plugin => overrides.get(plugin.id) ?? plugin);
|
|
10
|
+
return [...builtIns, ...additional.filter(plugin => !pluginRegistration(plugin)?.builtIn || !builtInPluginIds.has(plugin.id))];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=built-ins.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Plugin } from '@repometry/core/internal/engine/plugin.js';
|
|
2
|
+
import type { FindingIgnoreRule } from '@repometry/core/internal/model/ignore-rule.js';
|
|
3
|
+
import type { DiffCoveragePorts, DiffCoverageReport } from '@repometry/core/internal/usecases/diff-coverage.js';
|
|
4
|
+
import type { CoverageInputs } from '../api/import/lcov-files.js';
|
|
5
|
+
import type { ParserOrder } from './parser-order.js';
|
|
6
|
+
export { diffCoverageSchema } from '@repometry/core/internal/usecases/diff-coverage.js';
|
|
7
|
+
export type { DiffCoverageReport } from '@repometry/core/internal/usecases/diff-coverage.js';
|
|
8
|
+
export interface DiffCoverageRequest extends CoverageInputs {
|
|
9
|
+
readonly directory: string;
|
|
10
|
+
readonly revision: string;
|
|
11
|
+
readonly base: string;
|
|
12
|
+
readonly exclude?: readonly string[];
|
|
13
|
+
readonly ignore?: readonly FindingIgnoreRule[];
|
|
14
|
+
readonly minimumPercent?: number;
|
|
15
|
+
readonly plugins?: readonly Plugin[];
|
|
16
|
+
readonly parsers?: ParserOrder;
|
|
17
|
+
}
|
|
18
|
+
export declare function measureDiffCoverage(request: DiffCoverageRequest, overrides?: Partial<DiffCoveragePorts>): Promise<DiffCoverageReport>;
|
|
19
|
+
export declare function measureChangedLines(request: DiffCoverageRequest, overrides?: Partial<DiffCoveragePorts>): Promise<{
|
|
20
|
+
report: DiffCoverageReport;
|
|
21
|
+
uncovered: readonly {
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly lines: readonly number[];
|
|
24
|
+
}[];
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { execute } from '@repometry/core/internal/engine/execute.js';
|
|
2
|
+
import { plan } from '@repometry/core/internal/engine/plan.js';
|
|
3
|
+
import { digest, sourceDirectoriesExcluded, sourceLineCounts } from '@repometry/core/internal/model/snapshot.js';
|
|
4
|
+
import { coverageIgnore, readIgnoreRules, recordIgnoreRules } from '@repometry/core/internal/profile/ignore.js';
|
|
5
|
+
import { executeDiffCoverage } from '@repometry/core/internal/usecases/diff-coverage.js';
|
|
6
|
+
import { defaultSourceExclusions, generatedSourcePolicy, sourceExclusionMatcher } from '@repometry/core/internal/profile/exclusions.js';
|
|
7
|
+
import { changesInput } from '@repometry/core/internal/model/changes.js';
|
|
8
|
+
import { lcovInput } from '@repometry/core/internal/model/coverage-input.js';
|
|
9
|
+
import { diffCoverageResult } from '@repometry/core/internal/model/diff-coverage.js';
|
|
10
|
+
import { builtInPluginIds, builtInPlugins, registeredPlugins } from './built-ins.js';
|
|
11
|
+
import { candidatesOf, diffCoveragePhases, phaseInputs, selectOperations } from './phases.js';
|
|
12
|
+
import { diffMethod, findMergeBase, readChanges } from '../api/git/changes.js';
|
|
13
|
+
import { gitText, physicalGitRoot, readGitCommit, resolveGitCommit } from '../api/git/git.js';
|
|
14
|
+
import { readInspectionCoverage } from './inspection-coverage.js';
|
|
15
|
+
import { claimMatcher, defaultLanguages, languageRegistry } from './languages.js';
|
|
16
|
+
import { pluginScope, scopedMatcher } from './plugin-scope.js';
|
|
17
|
+
export { diffCoverageSchema } from '@repometry/core/internal/usecases/diff-coverage.js';
|
|
18
|
+
const { changedLines } = selectOperations(builtInPlugins, diffCoveragePhases, new Set(defaultLanguages.providers.map(({ key }) => key)));
|
|
19
|
+
const { plugin: measurer, key: operation } = changedLines.find(({ operation }) => operation.output === diffCoverageResult);
|
|
20
|
+
// The result records the version of the import-kind plugin that reads the coverage input.
|
|
21
|
+
const { plugin: importer } = changedLines.find(({ plugin, operation }) => plugin.kinds.includes('import')
|
|
22
|
+
&& Object.values(operation.inputs).includes(lcovInput));
|
|
23
|
+
const steps = diffPlan(changedLines);
|
|
24
|
+
function diffPlan(operations) {
|
|
25
|
+
const scope = new Map(operations.map(({ plugin }) => [plugin.id, scopedMatcher(plugin, claimMatcher(plugin.claims))]));
|
|
26
|
+
return plan({ plugins: candidatesOf(operations, scope), select: [operation], inputs: phaseInputs(diffCoveragePhases.changedLines) });
|
|
27
|
+
}
|
|
28
|
+
function coveragePlan(plugins = []) {
|
|
29
|
+
if (!plugins.some(plugin => builtInPluginIds.has(plugin.id) && pluginScope(plugin)))
|
|
30
|
+
return steps;
|
|
31
|
+
const registered = registeredPlugins(plugins).filter(plugin => builtInPluginIds.has(plugin.id));
|
|
32
|
+
return diffPlan(selectOperations(registered, diffCoveragePhases, new Set(defaultLanguages.providers.map(({ key }) => key))).changedLines);
|
|
33
|
+
}
|
|
34
|
+
export async function measureDiffCoverage(request, overrides) {
|
|
35
|
+
return (await measureChangedLines(request, overrides)).report;
|
|
36
|
+
}
|
|
37
|
+
export async function measureChangedLines(request, overrides) {
|
|
38
|
+
const rules = recordIgnoreRules(readIgnoreRules(request.ignore ?? [])).filter(({ category }) => category === 'coverage');
|
|
39
|
+
const ignores = coverageIgnore(rules);
|
|
40
|
+
return executeDiffCoverage(request, {
|
|
41
|
+
readInputs: (excludedPaths, excludes) => readInputs(request, excludedPaths, excludes, rules, ignores),
|
|
42
|
+
async measure({ changes, lcovText, root, snapshot }, excludes) {
|
|
43
|
+
const inputs = new Map([
|
|
44
|
+
['changes', { contract: changesInput.id, value: changes }],
|
|
45
|
+
['lcov', { contract: lcovInput.id, value: { text: lcovText, root, sourceLines: sourceLineCounts(snapshot.files), excludes: combine(excludes, ignores) } }],
|
|
46
|
+
]);
|
|
47
|
+
const result = (await execute(coveragePlan(request.plugins), inputs)).get(operation);
|
|
48
|
+
if (!result || result.state !== 'completed')
|
|
49
|
+
throw new Error(result?.reason ?? 'Diff coverage did not run');
|
|
50
|
+
return result.product.value; // execute() checked it against the contract
|
|
51
|
+
},
|
|
52
|
+
...overrides,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function combine(source, ignores) {
|
|
56
|
+
return ignores ? path => source(path) || ignores(path) : source;
|
|
57
|
+
}
|
|
58
|
+
async function readInputs(request, excludedPaths, excludes, rules, ignores) {
|
|
59
|
+
const root = await physicalGitRoot(request.directory);
|
|
60
|
+
const [requestedBase, head, gitVersion] = await Promise.all([
|
|
61
|
+
resolveGitCommit(root, request.base),
|
|
62
|
+
resolveGitCommit(root, request.revision),
|
|
63
|
+
gitText(root, ['--version']).then(text => text.trim()),
|
|
64
|
+
]);
|
|
65
|
+
const base = await findMergeBase(root, requestedBase, head);
|
|
66
|
+
const { isSource, extensions, globs } = languageRegistry(request.plugins ?? [], request.parsers);
|
|
67
|
+
const snapshot = await readGitCommit(root, head, { excludes, isSource });
|
|
68
|
+
const [lcov, changes] = await Promise.all([
|
|
69
|
+
readInspectionCoverage(request, { root, snapshot }),
|
|
70
|
+
readChanges(root, base, snapshot, combine(sourceExclusionMatcher(excludedPaths, snapshot.generatedExcluded), ignores), isSource),
|
|
71
|
+
]);
|
|
72
|
+
return { requestedBase, base, head, snapshot, changes, root, lcovText: lcov.text, appliedConfig: {
|
|
73
|
+
source: { extensions, ...(globs.length ? { globs } : {}), excludedDirectories: sourceDirectoriesExcluded, excludedPaths,
|
|
74
|
+
defaultExclusions: defaultSourceExclusions, generatedSourcePolicy, generatedExcluded: snapshot.generatedExcluded ?? [] },
|
|
75
|
+
gitDiff: { ...diffMethod, version: gitVersion },
|
|
76
|
+
lcov: { inputDigest: digest(lcov.text), pathBase: root, merge: 'any-hit', importerVersion: importer.version,
|
|
77
|
+
...(lcov.inputDigests.length > 1 ? { inputDigests: lcov.inputDigests } : {}) },
|
|
78
|
+
plugin: { id: measurer.id, version: measurer.version, api: measurer.api },
|
|
79
|
+
...(rules.length === 0 ? {} : { findingIgnore: rules }),
|
|
80
|
+
} };
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=diff-coverage.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BundledManifest } from '@repometry/core/internal/engine/plugin-manifest.js';
|
|
2
|
+
import type { Plugin } from '@repometry/core/internal/engine/plugin.js';
|
|
3
|
+
import type { ProvidedLanguage } from '@repometry/core/internal/model/language.js';
|
|
4
|
+
import type { ParserOrder } from './parser-order.js';
|
|
5
|
+
export interface Distribution {
|
|
6
|
+
readonly bundled: readonly Plugin[];
|
|
7
|
+
readonly parsers?: ParserOrder;
|
|
8
|
+
readonly moduleUrl?: string;
|
|
9
|
+
readonly packageUrl?: string;
|
|
10
|
+
readonly resolvePackage?: (name: string) => {
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly manifest: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const slimDistribution: Distribution;
|
|
16
|
+
export declare function distributionParsers(distribution?: Distribution, user?: ParserOrder): ParserOrder | undefined;
|
|
17
|
+
export declare function bundleLanguage(manifest: BundledManifest, language: ProvidedLanguage, requiresSource?: true): Plugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { bundledPlugin } from '@repometry/core/internal/engine/plugin-manifest.js';
|
|
2
|
+
import { duplicationSettings } from '@repometry/core/internal/profile/maintainability.js';
|
|
3
|
+
export const slimDistribution = { bundled: [] };
|
|
4
|
+
export function distributionParsers(distribution, user) {
|
|
5
|
+
return distribution?.parsers === undefined ? user : { ...distribution.parsers, ...user };
|
|
6
|
+
}
|
|
7
|
+
export function bundleLanguage(manifest, language, requiresSource) {
|
|
8
|
+
return { ...bundledPlugin(manifest),
|
|
9
|
+
providesLanguages: [language],
|
|
10
|
+
...(requiresSource === undefined ? {} : { languageProvenanceRequiresSource: requiresSource }),
|
|
11
|
+
settings: { duplication: { ...duplicationSettings, minTokens: duplicationSettings.minNodes } } };
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=distribution.js.map
|