@attalabs/vinaya 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/aeg-root/enforcement.md +4 -4
- package/aeg-root/roles/developer.md +23 -17
- package/aeg-root/roles/planner.md +2 -0
- package/aeg-root/roles/principal.md +4 -0
- package/aeg-root/roles/reviewer.md +3 -3
- package/aeg-root/roles/security.md +3 -3
- package/dist/checks/bin/check-body-bare-digits.js +915 -240
- package/dist/checks/bin/check-branch-topology.js +820 -180
- package/dist/checks/bin/check-brief-shape.js +915 -240
- package/dist/checks/bin/check-changeset-coverage.js +1534 -262
- package/dist/checks/bin/check-closes-n.js +824 -184
- package/dist/checks/bin/check-coherence.js +984 -265
- package/dist/checks/bin/check-dead-branch-push.js +805 -176
- package/dist/checks/bin/check-dispatch-readiness.js +1046 -276
- package/dist/checks/bin/check-doc-coverage-push.js +1530 -258
- package/dist/checks/bin/check-doc-coverage.js +1532 -260
- package/dist/checks/bin/check-doctrine-no-procedures.js +915 -240
- package/dist/checks/bin/check-doctrine-portability.js +1529 -257
- package/dist/checks/bin/check-evidence-fresh.js +1875 -258
- package/dist/checks/bin/check-exec-bits.js +1527 -255
- package/dist/checks/bin/check-first-push-dispatch.js +932 -246
- package/dist/checks/bin/check-issue-assignment.js +822 -182
- package/dist/checks/bin/check-issue-milestone-attach.js +5734 -0
- package/dist/checks/bin/check-issue-objectives-numbering.js +5736 -0
- package/dist/checks/bin/check-issue-parts-coverage.js +5736 -0
- package/dist/checks/bin/check-issue-surface-globs.js +6910 -0
- package/dist/checks/bin/check-issue-title-grammar.js +5736 -0
- package/dist/checks/bin/check-issue-tranche-label.js +5736 -0
- package/dist/checks/bin/check-main-branch-refusal.js +805 -176
- package/dist/checks/bin/check-no-disk-state.js +805 -176
- package/dist/checks/bin/check-pr-premise-reassert.js +915 -240
- package/dist/checks/bin/check-pr-report-density.js +805 -176
- package/dist/checks/bin/check-quoted-command.js +1508 -255
- package/dist/checks/bin/check-reader-resolvable-prose.js +1512 -259
- package/dist/checks/bin/check-registry-gates.js +892 -176
- package/dist/checks/bin/check-retired-vocabulary.js +1506 -253
- package/dist/checks/bin/check-review-gate.js +1000 -245
- package/dist/checks/bin/check-single-plan-pr.js +805 -176
- package/dist/checks/bin/check-surface-scope.js +830 -182
- package/dist/checks/bin/check-test-plan.js +834 -189
- package/dist/checks/bin/check-token-collection-wired.js +805 -176
- package/dist/checks/bin/check-token-report.js +805 -176
- package/dist/checks/bin/check-workspace-escape.js +1525 -253
- package/dist/index.js +9835 -5597
- package/dist/lib/pre-push-changed-files.js +57 -0
- package/dist/lib/pre-push-select-tests.js +1473 -0
- package/package.json +4 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/remote-base.ts
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
function cleanGitEnv() {
|
|
7
|
+
const env = { ...process.env };
|
|
8
|
+
for (const key of Object.keys(env)) {
|
|
9
|
+
if (key.startsWith("GIT_"))
|
|
10
|
+
delete env[key];
|
|
11
|
+
}
|
|
12
|
+
return env;
|
|
13
|
+
}
|
|
14
|
+
function git(repoRoot, args) {
|
|
15
|
+
try {
|
|
16
|
+
return execFileSync("git", args, {
|
|
17
|
+
cwd: repoRoot,
|
|
18
|
+
encoding: "utf8",
|
|
19
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
20
|
+
env: cleanGitEnv()
|
|
21
|
+
}).trim();
|
|
22
|
+
} catch {
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function resolveRemoteBase(repoRoot) {
|
|
27
|
+
const upstream = git(repoRoot, ["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]);
|
|
28
|
+
if (upstream)
|
|
29
|
+
return upstream;
|
|
30
|
+
const originMain = git(repoRoot, ["rev-parse", "--verify", "--quiet", "origin/main"]);
|
|
31
|
+
if (originMain)
|
|
32
|
+
return "origin/main";
|
|
33
|
+
return "HEAD~1";
|
|
34
|
+
}
|
|
35
|
+
function changedFilesSinceRemoteBase(repoRoot) {
|
|
36
|
+
const base = resolveRemoteBase(repoRoot);
|
|
37
|
+
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=ACMR", `${base}...HEAD`]);
|
|
38
|
+
return out.split(`
|
|
39
|
+
`).map((s) => s.trim()).filter(Boolean);
|
|
40
|
+
}
|
|
41
|
+
function changedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
42
|
+
return changedFilesSinceRemoteBase(repoRoot).map((f) => join(repoRoot, f));
|
|
43
|
+
}
|
|
44
|
+
function addedOrRenamedFilesSinceRemoteBase(repoRoot) {
|
|
45
|
+
const base = resolveRemoteBase(repoRoot);
|
|
46
|
+
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=AR", `${base}...HEAD`]);
|
|
47
|
+
return out.split(`
|
|
48
|
+
`).map((s) => s.trim()).filter(Boolean);
|
|
49
|
+
}
|
|
50
|
+
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
51
|
+
return addedOrRenamedFilesSinceRemoteBase(repoRoot).map((f) => join(repoRoot, f));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/lib/pre-push-changed-files.ts
|
|
55
|
+
for (const file of changedFilesSinceRemoteBase(process.cwd()))
|
|
56
|
+
process.stdout.write(`${file}
|
|
57
|
+
`);
|