Add bus-factor analyzer script
Implements scripts/bus-factor.mjs — a standalone Node.js CLI that shells out to git log --numstat to collect per-file, per-author commit stats, then computes bus-factor scores (number of contributors with >10% ownership) for every source file in server/src/, client/src/, and db/migrations/. High-risk files (bus-factor=1) are surfaced prominently in the default report. A --json flag emits machine-readable output for CI. Pure analysis functions (parseGitLog, computeOwnership, scoreFiles, repoStats) are unit-tested with Vitest (19 tests, all passing). No new runtime dependencies — only Node.js built-ins and git are required. Run via: node scripts/bus-factor.mjs [--json] [--min-commits N] [--top N] Nightshift-Task: bus-factor Nightshift-Ref: https://github.com/marcus/nightshift
This commit is contained in:
8
scripts/vitest.config.mjs
Normal file
8
scripts/vitest.config.mjs
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user