style: sync paired workspace sparse formatting

This commit is contained in:
Eyejoker
2026-03-28 21:34:25 +09:00
parent eee09e8b7c
commit 9006b92648
2 changed files with 24 additions and 17 deletions

View File

@@ -329,7 +329,10 @@ describe('paired workspace manager', () => {
runGit(['init'], canonicalDir);
runGit(['config', 'user.email', 'test@example.com'], canonicalDir);
runGit(['config', 'user.name', 'EJClaw Test'], canonicalDir);
fs.writeFileSync(path.join(canonicalDir, 'tracked.ts'), 'export const ok = 1;\n');
fs.writeFileSync(
path.join(canonicalDir, 'tracked.ts'),
'export const ok = 1;\n',
);
fs.writeFileSync(
path.join(canonicalDir, '.claude', 'settings.json'),
'{"secret":true}\n',
@@ -340,7 +343,13 @@ describe('paired workspace manager', () => {
);
fs.writeFileSync(path.join(canonicalDir, '.env.example'), 'EXAMPLE=1\n');
runGit(
['add', 'tracked.ts', '.claude/settings.json', '.env.production', '.env.example'],
[
'add',
'tracked.ts',
'.claude/settings.json',
'.env.production',
'.env.example',
],
canonicalDir,
);
runGit(['commit', '-m', 'initial'], canonicalDir);
@@ -371,9 +380,9 @@ describe('paired workspace manager', () => {
const reviewerWorkspace =
manager.refreshReviewerSnapshotForPairedTask('paired-task-4');
expect(
runGit(['status', '--short'], reviewerWorkspace.workspace_dir),
).toBe('');
expect(runGit(['status', '--short'], reviewerWorkspace.workspace_dir)).toBe(
'',
);
expect(
fs.existsSync(
path.join(reviewerWorkspace.workspace_dir, '.claude', 'settings.json'),

View File

@@ -92,11 +92,7 @@ function runGit(args: string[], cwd?: string): string {
}).trim();
}
function runGitWithInput(
args: string[],
cwd: string,
input: string,
): string {
function runGitWithInput(args: string[], cwd: string, input: string): string {
return execFileSync('git', args, {
cwd,
input,
@@ -181,11 +177,9 @@ function shouldIncludeUntrackedReviewerPath(relativePath: string): boolean {
}
function listAllowedTrackedFiles(sourceDir: string): string[] {
return listGitPaths(sourceDir, [
'ls-files',
'--cached',
'-z',
]).filter((relativePath) => !isReviewerSnapshotDeniedPath(relativePath));
return listGitPaths(sourceDir, ['ls-files', '--cached', '-z']).filter(
(relativePath) => !isReviewerSnapshotDeniedPath(relativePath),
);
}
function listDeletedTrackedFiles(sourceDir: string): string[] {
@@ -356,8 +350,12 @@ export function refreshReviewerSnapshotForPairedTask(
runGit(['clone', '--shared', ownerWorkspace.workspace_dir, reviewerDir]);
}
const allowedTrackedFiles = listAllowedTrackedFiles(ownerWorkspace.workspace_dir);
const deletedTrackedFiles = listDeletedTrackedFiles(ownerWorkspace.workspace_dir);
const allowedTrackedFiles = listAllowedTrackedFiles(
ownerWorkspace.workspace_dir,
);
const deletedTrackedFiles = listDeletedTrackedFiles(
ownerWorkspace.workspace_dir,
);
const allowedUntrackedFiles = listAllowedUntrackedFiles(
ownerWorkspace.workspace_dir,
);