repometry 0.10.0 → 0.11.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/README.md +5 -3
- package/package.json +1 -1
- package/target/main/resources/config/process-plugins-v1.schema.json +22 -0
- package/target/main/resources/report/json/config-v1.schema.json +125 -2
- package/target/main/resources/report/json/file-metrics-v1.schema.json +23 -1
- package/target/main/resources/report/json/pull-review-v2.schema.json +100 -0
- package/target/main/ts/api/cache/root.d.ts +3 -0
- package/target/main/ts/api/cache/root.js +21 -0
- package/target/main/ts/api/gh/github.d.ts +0 -4
- package/target/main/ts/api/gh/github.js +3 -33
- package/target/main/ts/api/git/blob-batch.js +2 -1
- 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/commit-metadata.d.ts +0 -1
- package/target/main/ts/api/git/commit-metadata.js +1 -10
- 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.d.ts +8 -1
- package/target/main/ts/api/git/git.js +58 -61
- package/target/main/ts/api/git/inspection-source.d.ts +2 -1
- package/target/main/ts/api/git/inspection-source.js +3 -2
- package/target/main/ts/api/git/local-sources.js +3 -2
- package/target/main/ts/api/git/source-cache.d.ts +0 -2
- package/target/main/ts/api/git/source-cache.js +1 -16
- 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/lcov-files.d.ts +3 -1
- package/target/main/ts/api/import/lcov-files.js +23 -4
- package/target/main/ts/api/process/go-parser-cache.d.ts +1 -0
- package/target/main/ts/api/process/go-parser-cache.js +71 -0
- package/target/main/ts/api/process/go-parser-files.d.ts +5 -0
- package/target/main/ts/api/process/go-parser-files.js +65 -0
- package/target/main/ts/api/process/host-language-runner.d.ts +3 -5
- package/target/main/ts/api/process/host-language-runner.js +21 -66
- package/target/main/ts/api/process/host-tool.d.ts +22 -0
- package/target/main/ts/api/process/host-tool.js +87 -0
- package/target/main/ts/cli/arguments.js +2 -4
- package/target/main/ts/cli/config.d.ts +20 -3
- package/target/main/ts/cli/config.js +43 -10
- package/target/main/ts/cli/imports.d.ts +1 -0
- package/target/main/ts/cli/imports.js +6 -2
- package/target/main/ts/cli/main.js +66 -215
- package/target/main/ts/cli/range-inspection.d.ts +25 -0
- package/target/main/ts/cli/range-inspection.js +29 -0
- package/target/main/ts/cli/range-jobs.d.ts +22 -0
- package/target/main/ts/cli/range-jobs.js +150 -0
- package/target/main/ts/cli/range-worker.d.ts +1 -0
- package/target/main/ts/cli/range-worker.js +36 -0
- package/target/main/ts/cli/reporting.d.ts +2 -7
- package/target/main/ts/cli/reporting.js +23 -37
- package/target/main/ts/compose/analysis-report.d.ts +1 -1
- package/target/main/ts/compose/analysis-report.js +8 -8
- package/target/main/ts/compose/analysis-results.d.ts +1 -1
- package/target/main/ts/compose/analysis-results.js +4 -6
- package/target/main/ts/compose/analysis-steps.d.ts +23 -0
- package/target/main/ts/compose/analysis-steps.js +215 -0
- package/target/main/ts/compose/analyze-snapshot.d.ts +1 -1
- package/target/main/ts/compose/analyze-snapshot.js +8 -12
- package/target/main/ts/compose/built-ins.d.ts +3 -0
- package/target/main/ts/compose/built-ins.js +5 -0
- package/target/main/ts/compose/diff-coverage.d.ts +2 -4
- package/target/main/ts/compose/diff-coverage.js +16 -13
- package/target/main/ts/compose/history-cache.d.ts +3 -1
- package/target/main/ts/compose/history-cache.js +2 -0
- package/target/main/ts/compose/inspect.d.ts +6 -9
- package/target/main/ts/compose/inspect.js +11 -12
- package/target/main/ts/compose/languages.d.ts +4 -1
- package/target/main/ts/compose/languages.js +9 -6
- package/target/main/ts/compose/native-language-plugins.d.ts +0 -1
- package/target/main/ts/compose/native-language-plugins.js +11 -17
- package/target/main/ts/compose/phases.d.ts +126 -0
- package/target/main/ts/compose/phases.js +154 -0
- package/target/main/ts/compose/plugin-list.d.ts +8 -2
- package/target/main/ts/compose/plugin-list.js +4 -13
- package/target/main/ts/compose/process-plugins.js +1 -1
- package/target/main/ts/compose/review.d.ts +2 -4
- package/target/main/ts/compose/review.js +10 -9
- package/target/main/ts/compose/sources.d.ts +1 -2
- package/target/main/ts/compose/sources.js +7 -7
- package/target/main/ts/core/engine/execute.d.ts +4 -1
- package/target/main/ts/core/engine/execute.js +1 -1
- package/target/main/ts/core/engine/manifest.d.ts +0 -1
- package/target/main/ts/core/engine/manifest.js +9 -13
- package/target/main/ts/core/engine/plugin.d.ts +1 -1
- package/target/main/ts/core/engine/report-products.js +3 -2
- package/target/main/ts/core/model/changes.d.ts +2 -0
- package/target/main/ts/core/model/changes.js +5 -1
- package/target/main/ts/core/model/clone-source.d.ts +2 -0
- package/target/main/ts/core/model/clone-source.js +4 -0
- package/target/main/ts/core/model/code-structure.d.ts +4 -1
- package/target/main/ts/core/model/code-structure.js +3 -1
- package/target/main/ts/core/model/coverage-input.d.ts +12 -0
- package/target/main/ts/core/model/coverage-input.js +11 -0
- package/target/main/ts/core/model/diff-coverage.d.ts +2 -0
- package/target/main/ts/core/model/diff-coverage.js +9 -1
- package/target/main/ts/core/model/language.d.ts +28 -0
- package/target/main/ts/core/model/language.js +25 -1
- package/target/main/ts/core/model/quality-summary.js +1 -1
- package/target/main/ts/core/model/report.d.ts +0 -2
- package/target/main/ts/core/model/report.js +0 -20
- package/target/main/ts/core/ports/tool-runner.d.ts +13 -0
- package/target/main/ts/core/usecases/inspect.d.ts +1 -2
- package/target/main/ts/core/usecases/review.js +11 -3
- package/target/main/ts/index.d.ts +6 -33
- package/target/main/ts/index.js +3 -18
- package/target/main/ts/plugin.d.ts +7 -3
- package/target/main/ts/plugin.js +3 -0
- package/target/main/ts/plugins/built-in.d.ts +6 -0
- package/target/main/ts/plugins/built-in.js +39 -0
- package/target/main/ts/plugins/coverage/coverage.d.ts +3 -24
- package/target/main/ts/plugins/coverage/coverage.js +8 -11
- package/target/main/ts/plugins/coverage/diff-coverage.d.ts +1 -5
- package/target/main/ts/plugins/coverage/diff-coverage.js +5 -14
- package/target/main/ts/plugins/duplication/duplication.d.ts +1 -3
- package/target/main/ts/plugins/duplication/duplication.js +2 -6
- package/target/main/ts/plugins/language-js/babel-provider.js +3 -2
- package/target/main/ts/plugins/language-js/structural-observations.js +1 -1
- 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 +1 -8
- package/target/main/ts/plugins/maintainability/maintainability.js +4 -10
- package/target/main/ts/plugins/source/forges.js +1 -1
- package/target/main/ts/report/html/app/viewer-languages.d.ts +3 -1
- package/target/main/ts/report/html/app/viewer-languages.js +11 -1
- package/target/main/ts/report/html/app/viewer-metrics-view.js +1 -1
- package/target/main/ts/report/html/app/viewer-source-view.js +2 -2
- package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +7 -6
- package/target/main/ts/report/html/app/viewer-tokenizer.js +72 -71
- package/target/main/ts/report/html/site/export-site.d.ts +1 -5
- package/target/main/ts/report/html/site/export-site.js +2 -6
- package/target/main/ts/report/html/site/projects.d.ts +1 -3
- package/target/main/ts/report/html/site/projects.js +2 -4
- package/target/main/ts/report/json/projections/commit-summary.js +5 -7
- package/target/main/ts/report/json/projections/file-metrics.js +1 -1
- package/target/main/ts/report/json/projections/inspection-context.d.ts +1 -0
- package/target/main/ts/report/json/projections/inspection-context.js +19 -1
- package/target/main/ts/report/json/projections/inspection-details.js +7 -2
- package/target/main/ts/report/json/projections/metric-values.d.ts +5 -0
- package/target/main/ts/report/json/projections/metric-values.js +9 -6
- package/target/main/ts/report/json/store/local-store.js +2 -0
- package/target/main/ts/report/json/store/replace-file.d.ts +1 -1
- package/target/main/ts/report/json/store/replace-file.js +24 -3
- package/target/main/ts/report/json/store/store-check.js +10 -1
- package/target/main/ts/report/json/validation/metabranch.d.ts +1 -1
- package/target/main/ts/report/json/validation/metabranch.js +6 -3
- package/target/main/ts/report/json/wire/file-metrics-model.d.ts +3 -1
- package/target/main/ts/report.d.ts +13 -1
- package/target/main/ts/report.js +7 -1
- package/target/main/ts/api/git/metabranch-worktree.d.ts +0 -1
- package/target/main/ts/api/git/metabranch-worktree.js +0 -35
- package/target/main/ts/api/worker/remote-executor.d.ts +0 -2
- package/target/main/ts/api/worker/remote-executor.js +0 -46
- package/target/main/ts/api/worker/worker-protocol.d.ts +0 -7
- package/target/main/ts/api/worker/worker-protocol.js +0 -127
- package/target/main/ts/api/worker/worker.d.ts +0 -5
- package/target/main/ts/api/worker/worker.js +0 -86
- package/target/main/ts/compose/analysis-files.d.ts +0 -15
- package/target/main/ts/compose/analysis-files.js +0 -129
- package/target/main/ts/compose/analysis-imports.d.ts +0 -7
- package/target/main/ts/compose/analysis-imports.js +0 -36
- package/target/main/ts/compose/analysis-repository.d.ts +0 -7
- package/target/main/ts/compose/analysis-repository.js +0 -99
- package/target/main/ts/compose/analysis-sources.d.ts +0 -48
- package/target/main/ts/compose/analysis-sources.js +0 -54
- package/target/main/ts/compose/prepare-metabranch.d.ts +0 -9
- package/target/main/ts/compose/prepare-metabranch.js +0 -17
- package/target/main/ts/compose/security-plugins.d.ts +0 -1
- package/target/main/ts/compose/security-plugins.js +0 -7
- package/target/main/ts/core/usecases/compare.d.ts +0 -6
- package/target/main/ts/core/usecases/compare.js +0 -189
- package/target/main/ts/report/json/store/components.d.ts +0 -2
- package/target/main/ts/report/json/store/components.js +0 -32
package/README.md
CHANGED
|
@@ -39,12 +39,14 @@ Run these commands in your repository. Without an install, start each with `npx`
|
|
|
39
39
|
| Command | What it does |
|
|
40
40
|
| --- | --- |
|
|
41
41
|
| `repometry analyze` | Analyze HEAD and save its inspection under `.repometry/`. |
|
|
42
|
-
| `repometry analyze HEAD~50..HEAD --skip-saved` | Build history for the last 50 commits, oldest first, skipping saved inspections. |
|
|
43
|
-
| `repometry analyze --import lcov=coverage/lcov.info --import sarif=results.sarif` | Import coverage and scanner results. Repeat `--import` for each file. |
|
|
42
|
+
| `repometry analyze HEAD~50..HEAD --skip-saved` | Build history for the last 50 commits, oldest first, skipping saved inspections. A long range uses every core; `--concurrency N` sets a limit. |
|
|
43
|
+
| `repometry analyze --import lcov=coverage/lcov.info --import sarif=results.sarif` | Import coverage and scanner results. Repeat `--import` for each file. [Commands and settings](docs/cli.md#analysis-settings) lists the formats, such as `cobertura` for `coverage.xml`. |
|
|
44
44
|
| `repometry view` | Open the report locally on a free port. Use `--port 3030` to choose a port. |
|
|
45
|
-
| `repometry report html` | Export a static report to `.repometry/report/html`. Use
|
|
45
|
+
| `repometry report html` | Export a static report to `.repometry/report/html`. Use `repometry report html=DIR` for another folder. |
|
|
46
46
|
| `repometry review origin/main --import lcov=coverage/lcov.info` | Report the issues a change adds or worsens on the lines it changes, and their coverage. |
|
|
47
47
|
| `repometry store check --repair --from git:origin/repometry` | Check saved inspections. `--repair` restores missing data from a copy. |
|
|
48
|
+
| `repometry history` | List saved inspections. `show REVISION` prints one report. See [Reading inspections](docs/store.md#reading-inspections). |
|
|
49
|
+
| `repometry projects DIR` | Build an index page for a folder of exported reports. See [Projects index](docs/cli.md#projects-index). |
|
|
48
50
|
| `repometry plugins` | List supported formats. |
|
|
49
51
|
| `repometry help analyze` | Get help for a command. |
|
|
50
52
|
|
package/package.json
CHANGED
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
|
|
59
59
|
"extensions": { "$ref": "#/$defs/extensions" },
|
|
60
60
|
"globs": { "$ref": "#/$defs/globs" },
|
|
61
|
+
"syntax": { "$ref": "#/$defs/syntax" },
|
|
61
62
|
"measures": {
|
|
62
63
|
"type": "array",
|
|
63
64
|
"uniqueItems": true,
|
|
@@ -70,6 +71,27 @@
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
"$defs": {
|
|
74
|
+
"syntax": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"lineComments": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/marker" } },
|
|
79
|
+
"blockComments": { "type": "array", "items": { "type": "array", "minItems": 2, "maxItems": 2,
|
|
80
|
+
"items": { "$ref": "#/$defs/syntax/$defs/marker" } } },
|
|
81
|
+
"strings": { "type": "array", "items": {
|
|
82
|
+
"type": "object", "required": ["quote"], "additionalProperties": false,
|
|
83
|
+
"properties": { "quote": { "$ref": "#/$defs/syntax/$defs/marker" },
|
|
84
|
+
"multiline": { "type": "boolean" }, "raw": { "type": "boolean" } }
|
|
85
|
+
} },
|
|
86
|
+
"stringPrefixes": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
87
|
+
"keywords": { "type": "array", "maxItems": 512, "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
88
|
+
"regexAfter": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } }
|
|
89
|
+
},
|
|
90
|
+
"$defs": {
|
|
91
|
+
"marker": { "type": "string", "minLength": 1, "maxLength": 8, "pattern": "^\\S+$" },
|
|
92
|
+
"word": { "type": "string", "pattern": "^[A-Za-z_$][\\w$]*$" }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
73
95
|
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
|
|
74
96
|
"text": { "type": "string", "pattern": "\\S" },
|
|
75
97
|
"positiveInteger": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
@@ -23,10 +23,133 @@
|
|
|
23
23
|
"reports": { "$ref": "#/$defs/strings" },
|
|
24
24
|
"sources": { "type": "string", "minLength": 1 },
|
|
25
25
|
"branch": { "type": "string", "minLength": 1 },
|
|
26
|
+
"components": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["name", "pathGlobs"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"name": { "type": "string", "maxLength": 100, "pattern": "\\S" },
|
|
33
|
+
"pathGlobs": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"minItems": 1,
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"pattern": "^(?![A-Za-z]:)(?:(?!\\.{1,2}(?:/|$))[^/\\\\\\u0000]+/)*(?!\\.{1,2}$)[^/\\\\\\u0000]+$"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"description": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
26
45
|
"minCoverage": { "type": "number", "minimum": 0, "maximum": 100 },
|
|
27
46
|
"minLines": { "type": "integer", "minimum": 0 },
|
|
28
|
-
"maxNewIssues": { "type": "integer", "minimum": 0 }
|
|
47
|
+
"maxNewIssues": { "type": "integer", "minimum": 0 },
|
|
48
|
+
"plugins": { "$ref": "urn:repometry:schema:process-plugins:1" }
|
|
29
49
|
},
|
|
30
50
|
"additionalProperties": false,
|
|
31
|
-
"$defs": {
|
|
51
|
+
"$defs": {
|
|
52
|
+
"strings": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
53
|
+
"processPlugins": {
|
|
54
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
55
|
+
"$id": "urn:repometry:schema:process-plugins:1",
|
|
56
|
+
"title": "Repometry process plugins",
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": ["id", "version", "image", "command", "scope", "tools", "providesLanguages"],
|
|
62
|
+
"properties": {
|
|
63
|
+
"id": { "$ref": "#/$defs/id" },
|
|
64
|
+
"version": { "$ref": "#/$defs/text" },
|
|
65
|
+
"image": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"pattern": "^(?:[a-z0-9][a-z0-9.:/_-]*@)?sha256:[a-f0-9]{64}$",
|
|
68
|
+
"description": "The full ID or distribution digest of a locally available Docker image."
|
|
69
|
+
},
|
|
70
|
+
"command": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"minItems": 1,
|
|
73
|
+
"items": { "type": "string", "pattern": "^[^\\u0000]*$" }
|
|
74
|
+
},
|
|
75
|
+
"scope": { "enum": ["file", "repository"] },
|
|
76
|
+
"fileIndependent": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "Each file's results and diagnostics are independent of the other files supplied to a repository parser."
|
|
79
|
+
},
|
|
80
|
+
"claims": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"additionalProperties": false,
|
|
83
|
+
"properties": {
|
|
84
|
+
"extensions": { "$ref": "#/$defs/extensions" },
|
|
85
|
+
"globs": { "$ref": "#/$defs/globs" }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"limits": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"additionalProperties": false,
|
|
91
|
+
"properties": {
|
|
92
|
+
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
|
|
93
|
+
"maxOutputBytes": { "$ref": "#/$defs/positiveInteger" },
|
|
94
|
+
"memoryBytes": { "$ref": "#/$defs/positiveInteger" },
|
|
95
|
+
"pidsLimit": { "$ref": "#/$defs/positiveInteger" }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"tools": { "type": "object", "minProperties": 1, "additionalProperties": { "$ref": "#/$defs/text" } },
|
|
99
|
+
"settings": true,
|
|
100
|
+
"providesLanguages": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"minItems": 1,
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": ["id", "label"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"id": { "$ref": "#/$defs/id" },
|
|
109
|
+
"label": { "$ref": "#/$defs/text" },
|
|
110
|
+
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
|
|
111
|
+
"extensions": { "$ref": "#/$defs/extensions" },
|
|
112
|
+
"globs": { "$ref": "#/$defs/globs" },
|
|
113
|
+
"syntax": { "$ref": "#/$defs/syntax" },
|
|
114
|
+
"measures": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"uniqueItems": true,
|
|
117
|
+
"items": { "enum": ["functions", "cyclomaticComplexity", "cognitiveComplexity", "classes",
|
|
118
|
+
"commentLines", "codeLines", "duplication", "structuralRules"] }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"$defs": {
|
|
126
|
+
"syntax": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"properties": {
|
|
130
|
+
"lineComments": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/marker" } },
|
|
131
|
+
"blockComments": { "type": "array", "items": { "type": "array", "minItems": 2, "maxItems": 2,
|
|
132
|
+
"items": { "$ref": "#/$defs/syntax/$defs/marker" } } },
|
|
133
|
+
"strings": { "type": "array", "items": {
|
|
134
|
+
"type": "object", "required": ["quote"], "additionalProperties": false,
|
|
135
|
+
"properties": { "quote": { "$ref": "#/$defs/syntax/$defs/marker" },
|
|
136
|
+
"multiline": { "type": "boolean" }, "raw": { "type": "boolean" } }
|
|
137
|
+
} },
|
|
138
|
+
"stringPrefixes": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
139
|
+
"keywords": { "type": "array", "maxItems": 512, "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
140
|
+
"regexAfter": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } }
|
|
141
|
+
},
|
|
142
|
+
"$defs": {
|
|
143
|
+
"marker": { "type": "string", "minLength": 1, "maxLength": 8, "pattern": "^\\S+$" },
|
|
144
|
+
"word": { "type": "string", "pattern": "^[A-Za-z_$][\\w$]*$" }
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
|
|
148
|
+
"text": { "type": "string", "pattern": "\\S" },
|
|
149
|
+
"positiveInteger": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
150
|
+
"extensions": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^\\.[\\w-]+$" } },
|
|
151
|
+
"globs": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/text" } }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
32
155
|
}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"items": {
|
|
17
17
|
"type": "object",
|
|
18
18
|
"required": ["id", "analysed"],
|
|
19
|
-
"properties": { "id": { "type": "string" }, "label": { "type": "string" }, "color": { "type": "string", "pattern": "^#[a-fA-F0-9]{6}$" }, "analysed": { "type": "boolean" }
|
|
19
|
+
"properties": { "id": { "type": "string" }, "label": { "type": "string" }, "color": { "type": "string", "pattern": "^#[a-fA-F0-9]{6}$" }, "analysed": { "type": "boolean" },
|
|
20
|
+
"syntax": { "$ref": "#/$defs/syntax" } },
|
|
20
21
|
"additionalProperties": false
|
|
21
22
|
}
|
|
22
23
|
},
|
|
@@ -50,6 +51,27 @@
|
|
|
50
51
|
},
|
|
51
52
|
"additionalProperties": false,
|
|
52
53
|
"$defs": {
|
|
54
|
+
"syntax": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"lineComments": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/marker" } },
|
|
59
|
+
"blockComments": { "type": "array", "items": { "type": "array", "minItems": 2, "maxItems": 2,
|
|
60
|
+
"items": { "$ref": "#/$defs/syntax/$defs/marker" } } },
|
|
61
|
+
"strings": { "type": "array", "items": {
|
|
62
|
+
"type": "object", "required": ["quote"], "additionalProperties": false,
|
|
63
|
+
"properties": { "quote": { "$ref": "#/$defs/syntax/$defs/marker" },
|
|
64
|
+
"multiline": { "type": "boolean" }, "raw": { "type": "boolean" } }
|
|
65
|
+
} },
|
|
66
|
+
"stringPrefixes": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
67
|
+
"keywords": { "type": "array", "maxItems": 512, "items": { "$ref": "#/$defs/syntax/$defs/word" } },
|
|
68
|
+
"regexAfter": { "type": "array", "items": { "$ref": "#/$defs/syntax/$defs/word" } }
|
|
69
|
+
},
|
|
70
|
+
"$defs": {
|
|
71
|
+
"marker": { "type": "string", "minLength": 1, "maxLength": 8, "pattern": "^\\S+$" },
|
|
72
|
+
"word": { "type": "string", "pattern": "^[A-Za-z_$][\\w$]*$" }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
53
75
|
"count": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
54
76
|
"optionalCount": { "anyOf": [{ "$ref": "#/$defs/count" }, { "type": "null" }] },
|
|
55
77
|
"observations": {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:repometry:schema:pull-review:2",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schema", "number", "generatedAt", "base", "mergeBase", "head", "changedFiles", "verdict", "issues", "debt", "coverage", "issueGate", "unmeasured", "notes"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"schema": { "const": "urn:repometry:schema:pull-review:2" },
|
|
8
|
+
"number": { "type": ["integer", "null"], "minimum": 1, "maximum": 9007199254740991 },
|
|
9
|
+
"generatedAt": { "type": "string" },
|
|
10
|
+
"base": { "type": "string", "minLength": 1 },
|
|
11
|
+
"mergeBase": { "$ref": "urn:repometry:schema:diff-coverage:1#/$defs/sha" },
|
|
12
|
+
"head": { "$ref": "urn:repometry:schema:diff-coverage:1#/$defs/sha" },
|
|
13
|
+
"changedFiles": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
14
|
+
"verdict": { "enum": ["passed", "failed", "unmeasured"] },
|
|
15
|
+
"issues": { "type": "array", "items": { "$ref": "#/$defs/issue" } },
|
|
16
|
+
"debt": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["added", "removed"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"added": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
21
|
+
"removed": { "$ref": "urn:repometry:schema:report:2#/$defs/count" }
|
|
22
|
+
},
|
|
23
|
+
"additionalProperties": false
|
|
24
|
+
},
|
|
25
|
+
"coverage": { "$ref": "#/$defs/coverage" },
|
|
26
|
+
"issueGate": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["maximum", "count", "status"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"maximum": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
31
|
+
"count": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
32
|
+
"status": { "enum": ["passed", "failed"] }
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
},
|
|
36
|
+
"unmeasured": { "type": "array", "items": { "$ref": "#/$defs/reason" } },
|
|
37
|
+
"notes": { "type": "array", "items": { "$ref": "#/$defs/reason" } }
|
|
38
|
+
},
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"$defs": {
|
|
41
|
+
"issue": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": ["effect", "finding", "before", "fixed", "context", "debtMinutes"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"effect": { "enum": ["new", "worsened", "improved", "touched"] },
|
|
46
|
+
"finding": { "$ref": "urn:repometry:schema:report:2#/$defs/finding" },
|
|
47
|
+
"before": { "type": ["number", "null"], "minimum": 0 },
|
|
48
|
+
"fixed": { "type": "boolean" },
|
|
49
|
+
"context": { "$ref": "urn:repometry:schema:report:2#/$defs/finding/properties/related" },
|
|
50
|
+
"debtMinutes": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
},
|
|
54
|
+
"coverage": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": ["imported", "covered", "total", "percent", "uncovered", "unmapped", "gate"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"imported": { "type": "boolean" },
|
|
59
|
+
"covered": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
60
|
+
"total": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
61
|
+
"percent": { "$ref": "urn:repometry:schema:diff-coverage:1#/properties/percent" },
|
|
62
|
+
"uncovered": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"required": ["path", "first", "last"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"path": { "type": "string", "minLength": 1 },
|
|
69
|
+
"first": { "type": "integer", "minimum": 1 },
|
|
70
|
+
"last": { "type": "integer", "minimum": 1 }
|
|
71
|
+
},
|
|
72
|
+
"additionalProperties": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"unmapped": { "$ref": "urn:repometry:schema:diff-coverage:1#/properties/gaps" },
|
|
76
|
+
"gate": {
|
|
77
|
+
"type": ["object", "null"],
|
|
78
|
+
"required": ["minimumPercent", "minimumLines", "status"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"minimumPercent": { "$ref": "urn:repometry:schema:diff-coverage:1#/$defs/percent" },
|
|
81
|
+
"minimumLines": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
|
|
82
|
+
"status": { "enum": ["passed", "failed", "not-applicable"] }
|
|
83
|
+
},
|
|
84
|
+
"additionalProperties": false
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
},
|
|
89
|
+
"reason": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"required": ["message"],
|
|
92
|
+
"properties": {
|
|
93
|
+
"message": { "type": "string" },
|
|
94
|
+
"path": { "type": "string" },
|
|
95
|
+
"operation": { "type": "string" }
|
|
96
|
+
},
|
|
97
|
+
"additionalProperties": false
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { rm } from 'node:fs/promises';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
export function cacheRoot(env = process.env, system = process.platform, home = homedir()) {
|
|
5
|
+
if (env.REPOMETRY_CACHE_DIR)
|
|
6
|
+
return resolve(env.REPOMETRY_CACHE_DIR);
|
|
7
|
+
if (env.XDG_CACHE_HOME)
|
|
8
|
+
return resolve(env.XDG_CACHE_HOME, 'repometry');
|
|
9
|
+
if (system === 'darwin')
|
|
10
|
+
return join(home, 'Library', 'Caches', 'repometry');
|
|
11
|
+
if (system === 'win32' && env.LOCALAPPDATA)
|
|
12
|
+
return resolve(env.LOCALAPPDATA, 'repometry', 'cache');
|
|
13
|
+
return join(home, '.cache', 'repometry');
|
|
14
|
+
}
|
|
15
|
+
export const goParserCacheDirectory = 'go-parsers-v1';
|
|
16
|
+
export async function clearCaches(root) {
|
|
17
|
+
const directories = ['sources', goParserCacheDirectory];
|
|
18
|
+
await Promise.all(directories.map(directory => rm(join(root, directory), { recursive: true, force: true })));
|
|
19
|
+
return directories;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { DiffCoverageReport } from '../../core/usecases/diff-coverage.js';
|
|
2
1
|
import type { PullReview } from '../../core/model/pull-review.js';
|
|
3
|
-
import type { Report } from '../../core/model/report.js';
|
|
4
|
-
export declare function writeGitHubResult(report: Report): Promise<void>;
|
|
5
|
-
export declare function writeGitHubDiffCoverage(report: DiffCoverageReport): Promise<void>;
|
|
6
2
|
/** The number of the pull request whose event started this GitHub Actions run, if any. */
|
|
7
3
|
export declare function gitHubPullRequest(): Promise<number | undefined>;
|
|
8
4
|
export declare function writeGitHubReview(review: PullReview, markdown: string, repository: string): Promise<void>;
|
|
@@ -2,28 +2,6 @@ import { appendFile, readFile, realpath } from 'node:fs/promises';
|
|
|
2
2
|
import { isAbsolute, relative, resolve, sep } from 'node:path';
|
|
3
3
|
import { isRecord } from '../../core/engine/plugin.js';
|
|
4
4
|
import { annotationLimit } from '../../core/model/pull-review.js';
|
|
5
|
-
export async function writeGitHubResult(report) {
|
|
6
|
-
const { output, summary } = githubFiles();
|
|
7
|
-
await appendFile(output, `subject=${report.subject.id}\nstatus=${report.status}\n`);
|
|
8
|
-
await appendFile(summary, [
|
|
9
|
-
'## Repometry', '',
|
|
10
|
-
`**${report.status}** · \`${report.subject.id}\``, '',
|
|
11
|
-
`Parsed ${report.scope.parsed} of ${report.scope.files} files.`,
|
|
12
|
-
`Measurements: ${report.measurements.length}. Diagnostics: ${report.diagnostics.length}.`, '', '',
|
|
13
|
-
].join('\n'));
|
|
14
|
-
}
|
|
15
|
-
export async function writeGitHubDiffCoverage(report) {
|
|
16
|
-
const { output, summary } = githubFiles();
|
|
17
|
-
const decision = report.decision?.status ?? '';
|
|
18
|
-
await appendFile(output, `status=${report.status}\npercent=${report.percent ?? ''}\ndecision=${decision}\n`);
|
|
19
|
-
const observed = report.percent === null ? '—' : `${report.percent.toFixed(2)}%`;
|
|
20
|
-
const policy = report.decision === null ? [] : [`Minimum ${report.decision.minimumPercent}% · **${report.decision.status}**`];
|
|
21
|
-
await appendFile(summary, ['## Repometry diff coverage', '',
|
|
22
|
-
`**${report.status}** · \`${report.base}\` → \`${report.head}\``, '',
|
|
23
|
-
`Observed coverage ${observed} (${report.covered}/${report.total} reported lines). Gaps: ${report.gaps.length}.`,
|
|
24
|
-
...policy, '', '',
|
|
25
|
-
].join('\n'));
|
|
26
|
-
}
|
|
27
5
|
/** The number of the pull request whose event started this GitHub Actions run, if any. */
|
|
28
6
|
export async function gitHubPullRequest() {
|
|
29
7
|
const path = process.env.GITHUB_EVENT_PATH;
|
|
@@ -35,10 +13,9 @@ export async function gitHubPullRequest() {
|
|
|
35
13
|
return typeof number === 'number' && Number.isSafeInteger(number) && number > 0 ? number : undefined;
|
|
36
14
|
}
|
|
37
15
|
export async function writeGitHubReview(review, markdown, repository) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
`changed-coverage=${review.coverage.percent ?? ''}`, ''].join('\n'));
|
|
16
|
+
const summary = process.env.GITHUB_STEP_SUMMARY;
|
|
17
|
+
if (!summary)
|
|
18
|
+
throw new Error('GitHub reporting requires GITHUB_STEP_SUMMARY');
|
|
42
19
|
await appendFile(summary, markdown);
|
|
43
20
|
const annotate = await annotator(repository);
|
|
44
21
|
review.issues.filter(issue => issue.effect === 'new' || issue.effect === 'worsened').slice(0, annotationLimit)
|
|
@@ -67,11 +44,4 @@ function data(value) {
|
|
|
67
44
|
function property(value) {
|
|
68
45
|
return data(value).replaceAll(':', '%3A').replaceAll(',', '%2C');
|
|
69
46
|
}
|
|
70
|
-
function githubFiles() {
|
|
71
|
-
const output = process.env.GITHUB_OUTPUT;
|
|
72
|
-
const summary = process.env.GITHUB_STEP_SUMMARY;
|
|
73
|
-
if (!output || !summary)
|
|
74
|
-
throw new Error('GitHub reporting requires GITHUB_OUTPUT and GITHUB_STEP_SUMMARY');
|
|
75
|
-
return { output, summary };
|
|
76
|
-
}
|
|
77
47
|
//# sourceMappingURL=github.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { validSubjectId } from '../../core/model/report.js';
|
|
3
|
+
import { gitExecutable } from './git-executable.js';
|
|
3
4
|
const idleTimeout = 10_000;
|
|
4
5
|
const maxBlobBytes = 64 * 1024 * 1024;
|
|
5
6
|
export class GitBlobBatch {
|
|
@@ -47,7 +48,7 @@ class BlobSession {
|
|
|
47
48
|
chunks;
|
|
48
49
|
buffer = Buffer.alloc(0);
|
|
49
50
|
constructor(directory) {
|
|
50
|
-
this.child = spawn(
|
|
51
|
+
this.child = spawn(gitExecutable(), ['--no-replace-objects', 'cat-file', '--batch'], { cwd: directory });
|
|
51
52
|
this.child.stderr.resume();
|
|
52
53
|
this.child.stdin.on('error', () => { });
|
|
53
54
|
this.child.on('error', error => this.child.stdout.destroy(error));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BlobRequest {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly estimatedBytes: number;
|
|
4
|
+
readonly contents: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface BlobFacts {
|
|
7
|
+
readonly lines: number | null;
|
|
8
|
+
readonly bytes?: Buffer;
|
|
9
|
+
}
|
|
10
|
+
type ReadBlobs = (ids: readonly string[]) => Promise<ReadonlyMap<string, Buffer>>;
|
|
11
|
+
export declare const gitBlobBatchBytes: number;
|
|
12
|
+
/** Keeps only inventory facts and requested bytes from the preceding snapshot. */
|
|
13
|
+
export declare class GitBlobHistory {
|
|
14
|
+
private readonly maxBatchBytes;
|
|
15
|
+
private previous;
|
|
16
|
+
constructor(maxBatchBytes?: number);
|
|
17
|
+
read(requests: readonly BlobRequest[], read: ReadBlobs): Promise<ReadonlyMap<string, BlobFacts>>;
|
|
18
|
+
private missingRequests;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { textLineCount } from '../../core/model/snapshot.js';
|
|
2
|
+
export const gitBlobBatchBytes = 64 * 1024 * 1024;
|
|
3
|
+
/** Keeps only inventory facts and requested bytes from the preceding snapshot. */
|
|
4
|
+
export class GitBlobHistory {
|
|
5
|
+
maxBatchBytes;
|
|
6
|
+
previous = new Map();
|
|
7
|
+
constructor(maxBatchBytes = gitBlobBatchBytes) {
|
|
8
|
+
this.maxBatchBytes = maxBatchBytes;
|
|
9
|
+
}
|
|
10
|
+
async read(requests, read) {
|
|
11
|
+
const current = new Map();
|
|
12
|
+
const missing = this.missingRequests(requests, current);
|
|
13
|
+
for (const batch of blobBatches(missing, this.maxBatchBytes))
|
|
14
|
+
await readBatch(batch, read, current);
|
|
15
|
+
this.previous = current;
|
|
16
|
+
return current;
|
|
17
|
+
}
|
|
18
|
+
missingRequests(requests, current) {
|
|
19
|
+
const missing = [];
|
|
20
|
+
for (const request of requests) {
|
|
21
|
+
const facts = this.previous.get(request.id);
|
|
22
|
+
if (!facts || (request.contents && facts.bytes === undefined))
|
|
23
|
+
missing.push(request);
|
|
24
|
+
else
|
|
25
|
+
current.set(request.id, request.contents ? facts : { lines: facts.lines });
|
|
26
|
+
}
|
|
27
|
+
return missing;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function readBatch(requests, read, current) {
|
|
31
|
+
const blobs = await read(requests.map(({ id }) => id));
|
|
32
|
+
for (const { id, contents } of requests) {
|
|
33
|
+
const bytes = blobs.get(id);
|
|
34
|
+
if (!bytes)
|
|
35
|
+
throw new Error(`Git blob unavailable: ${id}`);
|
|
36
|
+
current.set(id, { lines: textLineCount(bytes), ...(contents ? { bytes: Buffer.from(bytes) } : {}) });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function* blobBatches(requests, maxBytes) {
|
|
40
|
+
let batch = [];
|
|
41
|
+
let estimatedBytes = 0;
|
|
42
|
+
for (const request of requests) {
|
|
43
|
+
if (batch.length && estimatedBytes + request.estimatedBytes > maxBytes) {
|
|
44
|
+
yield batch;
|
|
45
|
+
batch = [];
|
|
46
|
+
estimatedBytes = 0;
|
|
47
|
+
}
|
|
48
|
+
batch.push(request);
|
|
49
|
+
estimatedBytes += request.estimatedBytes;
|
|
50
|
+
}
|
|
51
|
+
if (batch.length)
|
|
52
|
+
yield batch;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=blob-history.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gitText
|
|
1
|
+
import { gitText } from './git.js';
|
|
2
2
|
export function commitMetadataReader(repository) {
|
|
3
3
|
return async (revisions) => {
|
|
4
4
|
const result = new Map();
|
|
@@ -43,13 +43,4 @@ async function tagsByCommit(repository) {
|
|
|
43
43
|
}
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
46
|
-
export async function resolveGitBranch(repository, name) {
|
|
47
|
-
await gitText(repository, ['check-ref-format', `refs/heads/${name}`]);
|
|
48
|
-
try {
|
|
49
|
-
return await resolveGitCommit(repository, `refs/heads/${name}`);
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return resolveGitCommit(repository, `refs/remotes/origin/${name}`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
46
|
//# sourceMappingURL=commit-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function gitExecutable(path?: string | undefined): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { accessSync, constants, statSync } from 'node:fs';
|
|
2
|
+
import { delimiter, isAbsolute, join } from 'node:path';
|
|
3
|
+
let resolved;
|
|
4
|
+
export function gitExecutable(path = process.env.PATH) {
|
|
5
|
+
if (resolved && resolved.path === path)
|
|
6
|
+
return resolved.executable;
|
|
7
|
+
const executable = findGit(path);
|
|
8
|
+
resolved = { path, executable };
|
|
9
|
+
return executable;
|
|
10
|
+
}
|
|
11
|
+
function findGit(path) {
|
|
12
|
+
// Preserve native lookup for Windows and for PATH entries relative to the child's working directory.
|
|
13
|
+
if (process.platform === 'win32' || path === undefined)
|
|
14
|
+
return 'git';
|
|
15
|
+
for (const directory of path.split(delimiter)) {
|
|
16
|
+
if (!isAbsolute(directory))
|
|
17
|
+
return 'git';
|
|
18
|
+
const candidate = join(directory, 'git');
|
|
19
|
+
try {
|
|
20
|
+
if (!statSync(candidate).isFile())
|
|
21
|
+
continue;
|
|
22
|
+
accessSync(candidate, constants.X_OK);
|
|
23
|
+
return candidate;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// Continue searching when this entry cannot run Git.
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return 'git';
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=git-executable.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SourceSnapshot } from '../../core/model/snapshot.js';
|
|
2
|
+
import { GitBlobHistory } from './blob-history.js';
|
|
2
3
|
export declare function gitRoot(directory: string): Promise<string>;
|
|
3
4
|
export declare function physicalGitRoot(directory: string): Promise<string>;
|
|
4
5
|
export declare function gitText(directory: string, args: readonly string[], timeout?: number): Promise<string>;
|
|
@@ -36,5 +37,11 @@ export declare class GitBlobReader {
|
|
|
36
37
|
private answer;
|
|
37
38
|
private stop;
|
|
38
39
|
}
|
|
39
|
-
export
|
|
40
|
+
export interface GitSelection {
|
|
41
|
+
readonly excludes: (path: string) => boolean;
|
|
42
|
+
readonly isSource: (path: string) => boolean;
|
|
43
|
+
readonly claims?: (path: string) => boolean;
|
|
44
|
+
readonly history?: GitBlobHistory;
|
|
45
|
+
}
|
|
46
|
+
export declare function readGitCommit(directory: string, revision: string, { excludes, isSource, claims, history }: GitSelection): Promise<SourceSnapshot>;
|
|
40
47
|
export {};
|