@davidbyoung/software-factory 0.1.3 → 0.1.4
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 +12 -11
- package/actions/factory-agent/action.yml +1 -1
- package/agents/factory-e2e-reviewer.md +102 -0
- package/agents/factory-test-reviewer.md +26 -64
- package/agents/factory-ticket-readiness.md +14 -6
- package/dist/cli.mjs +29 -2
- package/dist/commands.d.mts +16 -0
- package/dist/commands.mjs +129 -0
- package/dist/config.d.mts +61 -13
- package/dist/config.mjs +267 -65
- package/dist/deps.d.mts +7 -4
- package/dist/deps.mjs +20 -9
- package/dist/doctor.d.mts +3 -2
- package/dist/doctor.mjs +19 -4
- package/dist/explain.d.mts +4 -2
- package/dist/explain.mjs +66 -19
- package/dist/guard-commit.d.mts +7 -2
- package/dist/guard-commit.mjs +58 -21
- package/dist/init.d.mts +4 -2
- package/dist/init.mjs +15 -5
- package/dist/lib/default-branch.d.mts +35 -0
- package/dist/lib/default-branch.mjs +117 -0
- package/dist/lib/refined-check.d.mts +7 -0
- package/dist/lib/refined-check.mjs +76 -0
- package/dist/patch-coverage.d.mts +13 -0
- package/dist/patch-coverage.mjs +73 -0
- package/dist/pr-watch.d.mts +3 -2
- package/dist/pr-watch.mjs +22 -5
- package/dist/pr.mjs +34 -2
- package/dist/session-start.d.mts +23 -13
- package/dist/session-start.mjs +56 -44
- package/dist/site/servers.d.mts +6 -2
- package/dist/site/servers.mjs +14 -9
- package/dist/site.mjs +2 -2
- package/dist/sync.d.mts +8 -2
- package/dist/sync.mjs +40 -6
- package/dist/ticket.mjs +19 -1
- package/docs/builds.md +8 -8
- package/docs/cli.md +82 -45
- package/docs/configuration.md +455 -139
- package/docs/design.md +17 -4
- package/docs/developing.md +37 -6
- package/docs/existing-repo.md +8 -6
- package/docs/github/by-hand.md +23 -10
- package/docs/github/reference.md +19 -14
- package/docs/github/setup.md +12 -9
- package/docs/glossary.md +13 -3
- package/docs/limitations.md +27 -2
- package/docs/plugins.md +302 -48
- package/docs/quick-start.md +36 -8
- package/docs/removing.md +1 -1
- package/docs/skills.md +101 -52
- package/docs/updating.md +148 -3
- package/docs/workflow.md +13 -10
- package/package.json +1 -1
- package/review.md +20 -11
- package/rules.md +22 -18
- package/settings.schema.json +289 -69
- package/skills/factory-address-review/SKILL.md +50 -30
- package/skills/factory-build/SKILL.md +75 -22
- package/skills/factory-deps/SKILL.md +46 -21
- package/skills/factory-design/SKILL.md +17 -8
- package/skills/factory-diagnose/SKILL.md +22 -20
- package/skills/factory-mutate/SKILL.md +38 -24
- package/skills/factory-refine/SKILL.md +55 -31
- package/skills/factory-resolve-conflicts/SKILL.md +76 -34
- package/skills/factory-trace/SKILL.md +3 -2
- package/workflows/factory-build.yml +1 -1
- package/workflows/factory-conflicts.yml +8 -8
- package/workflows/factory-deps.yml +1 -1
- package/workflows/factory-review.yml +1 -1
- package/skills/factory-address-review/patch-coverage.py +0 -68
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Lines a branch adds or changes that its tests leave uncovered.
|
|
3
|
-
|
|
4
|
-
Codecov's PR comment names files and counts, not lines. This reads the same
|
|
5
|
-
lcov report CI uploads and keeps only the lines in the diff against the base.
|
|
6
|
-
|
|
7
|
-
python3 patch-coverage.py [base] [lcov]
|
|
8
|
-
|
|
9
|
-
Run the project's coverage command first. Defaults: origin/main and
|
|
10
|
-
coverage/lcov.info. MISS is a line never run; PART is a line with a branch
|
|
11
|
-
never taken.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
import os
|
|
15
|
-
import re
|
|
16
|
-
import subprocess
|
|
17
|
-
import sys
|
|
18
|
-
|
|
19
|
-
base = sys.argv[1] if len(sys.argv) > 1 else "origin/main"
|
|
20
|
-
lcov = sys.argv[2] if len(sys.argv) > 2 else "coverage/lcov.info"
|
|
21
|
-
|
|
22
|
-
coverage = {}
|
|
23
|
-
current = None
|
|
24
|
-
for line in open(lcov):
|
|
25
|
-
line = line.strip()
|
|
26
|
-
if line.startswith("SF:"):
|
|
27
|
-
current = os.path.relpath(line[3:])
|
|
28
|
-
coverage[current] = {"miss": set(), "part": set()}
|
|
29
|
-
elif line.startswith("DA:"):
|
|
30
|
-
number, hits = line[3:].split(",")[:2]
|
|
31
|
-
if hits == "0":
|
|
32
|
-
coverage[current]["miss"].add(int(number))
|
|
33
|
-
elif line.startswith("BRDA:"):
|
|
34
|
-
number, _, _, taken = line[5:].split(",")
|
|
35
|
-
if taken in ("0", "-"):
|
|
36
|
-
coverage[current]["part"].add(int(number))
|
|
37
|
-
|
|
38
|
-
diff = subprocess.run(
|
|
39
|
-
["git", "diff", "-U0", f"{base}...HEAD"],
|
|
40
|
-
capture_output=True,
|
|
41
|
-
text=True,
|
|
42
|
-
check=True,
|
|
43
|
-
).stdout
|
|
44
|
-
changed = {}
|
|
45
|
-
path = None
|
|
46
|
-
for line in diff.splitlines():
|
|
47
|
-
if line.startswith("+++ "):
|
|
48
|
-
path = line[6:] if line.startswith("+++ b/") else None
|
|
49
|
-
if path:
|
|
50
|
-
changed[path] = set()
|
|
51
|
-
hunk = re.match(r"@@ .* \+(\d+)(?:,(\d+))? @@", line)
|
|
52
|
-
if hunk and path:
|
|
53
|
-
start, count = int(hunk[1]), int(hunk[2] or 1)
|
|
54
|
-
changed[path].update(range(start, start + count))
|
|
55
|
-
|
|
56
|
-
for path, lines in sorted(changed.items()):
|
|
57
|
-
report = coverage.get(path)
|
|
58
|
-
if not report:
|
|
59
|
-
continue
|
|
60
|
-
missed = report["miss"] & lines
|
|
61
|
-
partial = (report["part"] & lines) - missed
|
|
62
|
-
if not missed and not partial:
|
|
63
|
-
continue
|
|
64
|
-
source = open(path).read().splitlines()
|
|
65
|
-
print(f"=== {path}")
|
|
66
|
-
for number in sorted(missed | partial):
|
|
67
|
-
kind = "MISS" if number in missed else "PART"
|
|
68
|
-
print(f"{kind} {number}: {source[number - 1].strip()[:110]}")
|