CI: flag newly introduced dead code in nuxt-app (fallow) - #256
Draft
claude[bot] wants to merge 1 commit into
Draft
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds a dead-code step to the existing nuxt-app-test job. `fallow audit --base` scores only what a pull request introduces, so the 26 findings already in the tree neither block anyone nor need a baseline file that someone has to keep current. The step is `continue-on-error: true` for now: it annotates the diff without turning the job red while those findings are still there. The checkout for this job moves to `fetch-depth: 0`, because the audit diffs `origin/$GITHUB_BASE_REF...HEAD` and a depth-1 checkout has neither the base branch nor a merge base to diff against. `.fallowrc.json` silences the `shared-code` alias — declared in nuxt.config.ts, which fallow does not read, and good for 11 unresolved-import findings plus one unlisted dependency — and keeps complexity out of the verdict. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8WfQLANQ82xACc71SosSJ
claude
Bot
force-pushed
the
claude/fallow-dead-code-ci
branch
from
September 18, 2026 12:12
b8b3565 to
125a642
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Jan Gregor Emge-Triebel · Slack thread
Before: nothing in CI notices when code stops being used. An export whose last caller disappears during a refactor keeps getting formatted, linted, typechecked and built for years, and only turns up when somebody goes looking by hand. Nobody knew how much of it
nuxt-appcarries — the answer, measured here for the first time, is 26 findings: 2 unreachable files, 4 unused exports, 5 unused types, 4 unused store members, 2 unused component props, 2 import cycles, 6 dependency-hygiene findings and 1 unresolved import.After: every pull request that touches
nuxt-appruns a dead-code pass, and what it finds shows up as annotations on the diff lines themselves. Only findings the pull request introduces count towards the verdict; the 26 that are already in the tree are reported as inherited and gate nothing, so nobody has to clean up first. The step is advisory for now, so a wrong finding costs a scroll past an annotation, not a blocked merge.How
One step in the existing
nuxt-app-testjob, straight afternpm ci:audit --base, not a baseline file.fallow auditdiffs against the PR base and attributes every finding as introduced or inherited, so the gate is "this PR added dead code", not "this repository contains dead code". The alternative —dead-code --save-baseline— would mean a checked-in snapshot of all 26 findings that goes stale on every merge and has to be re-saved by hand. There is nothing to keep in sync here.continue-on-error: trueon purpose. A gate that is red on day one gets switched off rather than used. Remove that line once the 26 existing findings are cleaned up (separate PR — this one changes no application code); from then on a newly introduced dead export fails the job.fetch-depth: 0on the checkout of this job. This is the part that actually breaks in CI if you skip it. The audit resolvesorigin/$GITHUB_BASE_REF...HEAD, andactions/checkoutfetches depth 1 of the PR ref only. Reproduced locally against a depth-1 clone:fatal: ambiguous argument 'origin/main...HEAD': unknown revision, exit 2git fetch --depth=1 origin main→fatal: origin/main...HEAD: no merge base, exit 2A shallow, targeted fetch would have to guess a depth that always reaches the merge base. The repository is ~11 MB, so fetching all of it is cheaper than being clever.
Pinned version, run through
npx, not a devDependency. fallow ships a ~54 MB platform binary plus a ~27 MB type-aware sidecar (~139 MB unpacked). As a devDependency that lands in everynpm ci— every local install and every Vercel build — for a tool only CI runs. The trade-off is that Renovate, which is scoped tonuxt-app/**, will not see the pin in the workflow file, so version bumps are a manual one-line edit.nuxt-app/.fallowrc.jsonturns off what is noise on this codebase. Every key was verified by running the tool with and without it and comparing the output — fallow rejects unknown keys outright (exit 2), so a typo cannot pass silently:ignoreUnresolvedImports+ignoreDependenciesforshared-codeshared-codeis a Nuxt alias fromnuxt.config.ts, which fallow does not read: 11 unresolved imports plus 1 unlisted dependency, all false positiveshealth.ignore: ["**"]rules.boundary-violation/policy-violationoffrules.unused-class-membersoffDuplication needs no key: it is reported but never gates (
duplicates.thresholddefaults to 0 = no limit), confirmed by running an artificial clone through the audit both ways. Current duplication is 4.4%..fallow/(analysis cache, ~800 KB) is added tonuxt-app/.gitignore. The audit's base snapshots go to/tmp, not into the working tree, soprettier:checkand ESLint see nothing new.Verification
Run locally in
nuxt-app, using the exact command from the workflow:origin/mainUnused file, verdictfailedwarnedAnalysis itself is ~130 ms; the rest is process start-up. Cold
npxdownload of the pinned version took 4.3 s here, so the CI step should cost well under 30 s. The throwaway commits used for the failing runs are not part of this branch.prettier:check(exit 0),npm run lint(exit 0, 127 pre-existing warnings) andpython -c "yaml.safe_load(...)"on the workflow all still pass, and the Directustestjob is untouched.Not in this PR
directus-cmsis out of scope, as agreed.🤖 Generated with Claude Code
https://claude.ai/code/session_01G8WfQLANQ82xACc71SosSJ