MCPcopy
hub / github.com/openclaw/clawsweeper / classifyCommand

Function classifyCommand

src/commit-sweeper.ts:519–545  ·  view source on GitHub ↗
(args: Args)

Source from the content-addressed store, hash-verified

517}
518
519function classifyCommand(args: Args): void {
520 const targetRepo = argString(args, "target_repo", DEFAULT_TARGET_REPO);
521 const targetDir = resolve(
522 argString(args, "target_dir", repositoryProfileFor(targetRepo).checkoutDir),
523 );
524 const artifactDir = resolve(argString(args, "artifact_dir", "skipped-commit-artifacts"));
525 const commits = commitShasArg(argString(args, "commit_shas", ""));
526 const review: string[] = [];
527 const skipped: string[] = [];
528 for (const sha of commits) {
529 const metadata = commitMetadata(targetDir, targetRepo, sha);
530 const changedFiles = changedFilesForCommit(targetDir, sha, metadata.parents);
531 if (changedFiles.some(isReviewableCommitPath)) {
532 review.push(sha);
533 continue;
534 }
535 const outputPath = join(artifactDir, artifactReportRelativePath(targetRepo, sha));
536 ensureDir(dirname(outputPath));
537 writeFileSync(
538 outputPath,
539 skippedNonCodeReport({ targetRepo, sha, metadata, changedFiles }),
540 "utf8",
541 );
542 skipped.push(sha);
543 }
544 console.log(JSON.stringify({ review, skipped }, null, 2));
545}
546
547function publishCheckCommand(args: Args): void {
548 const targetRepo = argString(args, "target_repo", DEFAULT_TARGET_REPO);

Callers 1

mainFunction · 0.70

Calls 8

argStringFunction · 0.85
repositoryProfileForFunction · 0.85
commitShasArgFunction · 0.85
commitMetadataFunction · 0.85
changedFilesForCommitFunction · 0.85
skippedNonCodeReportFunction · 0.85
ensureDirFunction · 0.70

Tested by

no test coverage detected