Skip to content

Commit ca7ba2a

Browse files
committed
style: fix lint and formatting in fixtures and tests (#542)
1 parent 94dd0f9 commit ca7ba2a

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

tests/benchmarks/resolution/fixtures/typescript/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { JsonSerializer } from './serializer';
2-
import { createService, UserService } from './service';
2+
import { createService, type UserService } from './service';
33

44
export function main(): void {
55
const svc = createService();

tests/fixtures/deep-deps-project/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { runQuery } from './features/query.js';
21
import { formatOutput } from './features/format.js';
2+
import { runQuery } from './features/query.js';
33
import { MAX_ITEMS } from './shared/constants.js';
44

55
export function main(input, page) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { MAX_ITEMS, clamp } from '../shared/index.js';
1+
import { clamp, MAX_ITEMS } from '../shared/index.js';
22

33
export function parseItems(raw) {
4-
const items = raw.split(',').map(s => s.trim());
4+
const items = raw.split(',').map((s) => s.trim());
55
return items.slice(0, clamp(items.length, 0, MAX_ITEMS));
66
}

tests/fixtures/deep-deps-project/features/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { parseItems } from '../domain/index.js';
2-
import { paginate } from '../shared/helpers.js';
32
import { clamp } from '../shared/constants.js';
3+
import { paginate } from '../shared/helpers.js';
44

55
export function runQuery(raw, page) {
66
const items = parseItems(raw);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { MAX_ITEMS, DEFAULT_NAME, clamp } from './constants.js';
2-
export { paginate, formatName } from './helpers.js';
1+
export { clamp, DEFAULT_NAME, MAX_ITEMS } from './constants.js';
2+
export { formatName, paginate } from './helpers.js';

tests/integration/incr-edge-gap.test.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@ function copyDirSync(src, dest) {
2323

2424
function readEdges(dbPath) {
2525
const db = new Database(dbPath, { readonly: true });
26-
const edges = db.prepare(`
26+
const edges = db
27+
.prepare(`
2728
SELECT n1.name AS src_name, n1.kind AS src_kind, n1.file AS src_file,
2829
n2.name AS tgt_name, n2.kind AS tgt_kind, n2.file AS tgt_file,
2930
e.kind AS edge_kind, e.confidence
3031
FROM edges e
3132
JOIN nodes n1 ON e.source_id = n1.id
3233
JOIN nodes n2 ON e.target_id = n2.id
3334
ORDER BY src_file, src_name, tgt_file, tgt_name, e.kind
34-
`).all();
35-
const nodes = db.prepare(
36-
'SELECT name, kind, file, line FROM nodes ORDER BY name, kind, file, line'
37-
).all();
35+
`)
36+
.all();
37+
const nodes = db
38+
.prepare('SELECT name, kind, file, line FROM nodes ORDER BY name, kind, file, line')
39+
.all();
3840
db.close();
3941
return { edges, nodes };
4042
}
@@ -73,8 +75,8 @@ describe('Issue #533: incremental edge gap', () => {
7375
// Detailed edge comparison
7476
const fullKeys = new Set(fullGraph.edges.map(edgeKey));
7577
const incrKeys = new Set(incrGraph.edges.map(edgeKey));
76-
const missing = [...fullKeys].filter(k => !incrKeys.has(k));
77-
const extra = [...incrKeys].filter(k => !fullKeys.has(k));
78+
const missing = [...fullKeys].filter((k) => !incrKeys.has(k));
79+
const extra = [...incrKeys].filter((k) => !fullKeys.has(k));
7880

7981
if (missing.length > 0 || extra.length > 0) {
8082
console.log(`\nFull build: ${fullGraph.edges.length} edges`);
@@ -115,8 +117,8 @@ describe('Issue #533: incremental edge gap', () => {
115117

116118
const fullKeys = new Set(fullGraph.edges.map(edgeKey));
117119
const incrKeys = new Set(incrGraph.edges.map(edgeKey));
118-
const missing = [...fullKeys].filter(k => !incrKeys.has(k));
119-
const extra = [...incrKeys].filter(k => !fullKeys.has(k));
120+
const missing = [...fullKeys].filter((k) => !incrKeys.has(k));
121+
const extra = [...incrKeys].filter((k) => !fullKeys.has(k));
120122

121123
if (missing.length > 0 || extra.length > 0) {
122124
console.log(`\nFull: ${fullGraph.edges.length}, Incr: ${incrGraph.edges.length}`);

tests/integration/watcher-rebuild.test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import os from 'node:os';
1414
import path from 'node:path';
1515
import Database from 'better-sqlite3';
1616
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
17-
import { buildGraph } from '../../src/domain/graph/builder.js';
18-
import { rebuildFile } from '../../src/domain/graph/builder/incremental.js';
1917
import { getNodeId as getNodeIdQuery, initSchema, openDb } from '../../src/db/index.js';
18+
import { rebuildFile } from '../../src/domain/graph/builder/incremental.js';
19+
import { buildGraph } from '../../src/domain/graph/builder.js';
2020

2121
const FIXTURE_DIR = path.join(import.meta.dirname, '..', 'fixtures', 'deep-deps-project');
2222

@@ -73,9 +73,7 @@ function makeStmts(db) {
7373
findNodeByName: db.prepare(
7474
"SELECT id, file FROM nodes WHERE name = ? AND kind IN ('function', 'method', 'class', 'interface', 'type', 'struct', 'enum', 'trait', 'record', 'module', 'constant')",
7575
),
76-
listSymbols: db.prepare(
77-
"SELECT name, kind, line FROM nodes WHERE file = ? AND kind != 'file'",
78-
),
76+
listSymbols: db.prepare("SELECT name, kind, line FROM nodes WHERE file = ? AND kind != 'file'"),
7977
};
8078

8179
const origDeleteEdges = db.prepare(

0 commit comments

Comments
 (0)