Repository navigation
feat: add native coverage, audit, duplication, and SAST gates - #19
Merged
Merged
Conversation
Cover the four quality gaps (coverage, SCA, SAST, duplication) using the existing pnpm/vitest/oxlint stack rather than adding a separate quality tool. - vitest.config.ts: v8 coverage with an 80% threshold (Stmts/Branch/Funcs/Lines) - package.json: `test` runs `vitest run --coverage`; add `lint:audit` (`pnpm audit --prod`) and `lint:duplicates` (jscpd, 5% threshold), wired into the `lint` aggregate; new devDeps @vitest/coverage-v8, jscpd - .oxlintrc.json: enable security rules (no-eval, no-implied-eval, no-new-func, no-unsafe-finally, no-unsafe-negation, no-unsafe-optional-chaining) - .gitignore: ignore generated coverage/ and report/ so biome check . stays green after a local test run Verified: build, full lint, and test all pass; the gate is idempotent (lint stays green even when coverage/ is present).
- Tech Stack: add @vitest/coverage-v8 and jscpd - Lint table: add lint:audit (pnpm audit --prod) and lint:duplicates (jscpd) - Test: note that pnpm test enforces an 80% coverage threshold - Quick Start: mention test runs coverage
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.
Summary
Adds the four quality gaps — coverage, SCA (dependency audit), SAST, and code duplication — natively, using the existing
pnpm+vitest+oxlintstack. No new quality-tool binary, no second config system.This came out of evaluating LucidShark: every capability it adds is achievable with tools this template already uses, so this keeps the stack lean.
Changes
vitest.config.ts— v8 coverage with an 80% threshold (statements/branches/functions/lines). Gated viatest(vitest run --coverage);test:watchstays clean.package.jsontest→vitest run --coverage(coverage gate)lint:audit→pnpm audit --prod(production dependency vulnerability scan)lint:duplicates→jscpd(duplication gate, 5% threshold)lintaggregate@vitest/coverage-v8,jscpd.oxlintrc.json— enable 6 security-oriented rules (verified passing on current code):no-eval,no-implied-eval,no-new-func,no-unsafe-finally,no-unsafe-negation,no-unsafe-optional-chaining.gitignore— ignore generatedcoverage/andreport/sobiome check .stays green after a local test run (biome usesvcs.useIgnoreFile)Why these thresholds
pnpm audit --prod— gates shipped (production) vulnerabilities; avoids breaking CI on dev-only transitive advisories.Verification
pnpm build,pnpm lint,pnpm testall pass (true exit codes).pnpm lintstays green even whencoverage/exists (i.e. after runningtestthenlintlocally).pnpm install --frozen-lockfilesucceeds (CI parity).Gap → native solution
pnpm testpnpm audit --prodpnpm lintpnpm lintpnpm lint