Skip to content

Commit 0265635

Browse files
committed
fix(ci): keep unused exports advisory
1 parent 90c4a6f commit 0265635

3 files changed

Lines changed: 16 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,18 +1604,9 @@ jobs:
16041604
' "$1"
16051605
}
16061606
if has_package_script "deadcode:dependencies" &&
1607-
has_package_script "deadcode:unused-files" &&
1608-
has_package_script "deadcode:exports"; then
1607+
has_package_script "deadcode:unused-files"; then
16091608
pnpm deadcode:dependencies
16101609
pnpm deadcode:unused-files
1611-
pnpm deadcode:exports
1612-
elif [[ "$HISTORICAL_TARGET" == "true" ]] &&
1613-
has_package_script "deadcode:dependencies" &&
1614-
has_package_script "deadcode:unused-files" &&
1615-
has_package_script "deadcode:report:ci:ts-unused"; then
1616-
pnpm deadcode:dependencies
1617-
pnpm deadcode:unused-files
1618-
pnpm deadcode:report:ci:ts-unused
16191610
elif [[ "$HISTORICAL_TARGET" == "true" ]] && has_package_script "deadcode:ci"; then
16201611
pnpm deadcode:ci
16211612
else

docs/ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ job budget.
111111

112112
Android CI runs both `testPlayDebugUnitTest` and `testThirdPartyDebugUnitTest` and then builds the Play debug APK. The third-party flavor has no separate source set or manifest; its unit-test lane still compiles the flavor with the SMS/call-log BuildConfig flags, while avoiding a duplicate debug APK packaging job on every Android-relevant push.
113113

114-
The `check-dependencies` shard runs a production Knip dependency-only pass, the unused-file allowlist check, and the enforced unused-exports baseline ratchet. The unused-file guard fails when a PR adds a new unreviewed unused file or leaves a stale allowlist entry, while preserving intentional dynamic plugin, generated, build, live-test, and package bridge surfaces that Knip cannot resolve statically. The unused-exports ratchet likewise rejects new findings and stale required baseline entries, so the checked-in debt can only shrink. The former ts-prune and ts-unused-exports advisory reports no longer run.
114+
The `check-dependencies` shard runs a production Knip dependency-only pass and the unused-file allowlist check. The unused-file guard fails when a PR adds a new unreviewed unused file or leaves a stale allowlist entry, while preserving intentional dynamic plugin, generated, build, live-test, and package bridge surfaces that Knip cannot resolve statically. The unused-exports baseline remains available as an advisory maintenance scan through `pnpm deadcode:exports`; after deleting dead code, regenerate it with `pnpm deadcode:exports:update`.
115115

116116
## ClawSweeper activity forwarding
117117

test/scripts/ci-workflow-guards.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,17 +1746,13 @@ describe("ci workflow guards", () => {
17461746
expect(preflightGuards).toContain("pnpm deps:patches:check");
17471747
});
17481748

1749-
it("uses the target-owned deadcode contract for current and frozen checkouts", () => {
1749+
it("uses stable deadcode checks for current and frozen checkouts", () => {
17501750
const modern = runDependencyCheckFixture({
17511751
historicalTarget: false,
17521752
scripts: ["deadcode:dependencies", "deadcode:unused-files", "deadcode:exports"],
17531753
});
17541754
expect(modern.status, modern.output).toBe(0);
1755-
expect(modern.calls).toEqual([
1756-
"deadcode:dependencies",
1757-
"deadcode:unused-files",
1758-
"deadcode:exports",
1759-
]);
1755+
expect(modern.calls).toEqual(["deadcode:dependencies", "deadcode:unused-files"]);
17601756

17611757
const frozen = runDependencyCheckFixture({
17621758
historicalTarget: true,
@@ -1768,15 +1764,18 @@ describe("ci workflow guards", () => {
17681764
],
17691765
});
17701766
expect(frozen.status, frozen.output).toBe(0);
1771-
expect(frozen.calls).toEqual([
1772-
"deadcode:dependencies",
1773-
"deadcode:unused-files",
1774-
"deadcode:report:ci:ts-unused",
1775-
]);
1767+
expect(frozen.calls).toEqual(["deadcode:dependencies", "deadcode:unused-files"]);
1768+
1769+
const legacy = runDependencyCheckFixture({
1770+
historicalTarget: true,
1771+
scripts: ["deadcode:ci"],
1772+
});
1773+
expect(legacy.status, legacy.output).toBe(0);
1774+
expect(legacy.calls).toEqual(["deadcode:ci"]);
17761775

17771776
const incompleteCurrent = runDependencyCheckFixture({
17781777
historicalTarget: false,
1779-
scripts: ["deadcode:dependencies", "deadcode:unused-files"],
1778+
scripts: ["deadcode:dependencies"],
17801779
});
17811780
expect(incompleteCurrent.status).toBe(1);
17821781
expect(incompleteCurrent.calls).toEqual([]);
@@ -2066,8 +2065,9 @@ describe("ci workflow guards", () => {
20662065
);
20672066
expect(checkShard.run).toContain("pnpm tsgo:scripts");
20682067
expect(checkShard.run).toContain('elif [[ "$HISTORICAL_TARGET" != "true" ]]');
2069-
expect(checkShard.run).toContain('has_package_script "deadcode:exports"');
2070-
expect(checkShard.run).toContain('has_package_script "deadcode:report:ci:ts-unused"');
2068+
expect(checkShard.run).toContain('has_package_script "deadcode:dependencies"');
2069+
expect(checkShard.run).toContain('has_package_script "deadcode:unused-files"');
2070+
expect(checkShard.run).not.toContain('has_package_script "deadcode:exports"');
20712071
expect(checkShard.run).toContain(
20722072
'elif [[ "$HISTORICAL_TARGET" == "true" ]] && has_package_script "deadcode:ci"',
20732073
);

0 commit comments

Comments
 (0)