-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdiff-impact.js
More file actions
28 lines (27 loc) · 1.1 KB
/
Copy pathdiff-impact.js
File metadata and controls
28 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { diffImpact } from '../../presentation/queries-cli.js';
export const command = {
name: 'diff-impact [ref]',
description: 'Show impact of git changes (unstaged, staged, or vs a ref)',
options: [
['-d, --db <path>', 'Path to graph.db'],
['-T, --no-tests', 'Exclude test/spec files from results'],
['--include-tests', 'Include test/spec files (overrides excludeTests config)'],
['--limit <number>', 'Max results to return'],
['--offset <number>', 'Skip N results (default: 0)'],
['--ndjson', 'Newline-delimited JSON output'],
['--staged', 'Analyze staged changes instead of unstaged'],
['--depth <n>', 'Max transitive caller depth', '3'],
['-f, --format <format>', 'Output format: text, mermaid, json', 'text'],
['--no-implementations', 'Exclude interface/trait implementors from blast radius'],
],
execute([ref], opts, ctx) {
diffImpact(opts.db, {
ref,
staged: opts.staged,
depth: parseInt(opts.depth, 10),
format: opts.format,
includeImplementors: opts.implementations !== false,
...ctx.resolveQueryOpts(opts),
});
},
};