Repository navigation
·
78 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Features
- A top-level
baselinesconfig section sets the baseline file of each analysis for every command.baselines.deadCode,baselines.healthandbaselines.dupeshold paths relative to the project root. When you pass no baseline flag,fallow dead-code,fallow architecture,fallow health,fallow dupes, the barefallowrun,fallow auditandfallow baselines pruneread the matching file. A baseline flag overrides the key for one run, and a run that saves a baseline ignores that key. The new global--no-baselineflag turns config baselines off for one run. A missing file exits with code 2 and prints the--save-baselinecommand that creates it. The typed API runners and the typed route of the MCP tools do not apply the section yet; the API returnsFALLOW_CONFIG_BASELINE_UNSUPPORTED, and the MCP tools run the CLI instead. Older fallow versions reject the key, so set"minimumVersion": "3.53.0"with it. (#5695) Thanks @cloud-walker for the proposal. - The agent gate can block when it cannot run the audit. Set
FALLOW_GATE_STRICT=1, or runfallow agent install --strictand commit the gate script for the whole team. The gate then blocks a git commit or push (exit 2) when it finds no fallow binary, no JSON reader or no usable audit result. The block message names the fix. In strict mode, the gate also blocks a commit in a fresh clone without an install, and the first commit of a new repository.--no-strictturns strict mode off, andFALLOW_GATE_STRICT=0skips the audit for one session. The default stays fail open, and each fail-open notice now namesFALLOW_GATE_STRICT=1. (#5611, #5613) fallow auditreports facts about each complexity finding that a change cleared. A split into helpers always lowers the score of a function, so the score cannot show how a finding was cleared. The audit JSON, the review brief, the MCPaudittool and the Nodeauditbinding now have acleared_complexityobject. It gives the cognitive total on the base and on the head, with single-use helpers read inline. It also gives the data coupling of each new helper.flat_totalis true when the head total is 90% or more of the base total.coupled_helperis true when a new helper has 4 or more parameters or a coupling fact. Neither flag changes the verdict or the exit code, and the SARIF and CodeClimate output do not include them. (#5731)- A static survivor of
fallow mutationnames the test files of its export. Asurvivedstatic mutant in a value export declaration now has atest_reachobject. Itstestslist gives the test files that reference the export, so you can see where an assertion belongs.fallow mutation tasks,fallow mutation inspectand the human output show the same files. Adirectreach on ano_coveragemutant now also lists itstests; before,testswas present only formocked-only. Readreachbefore you readtests. Atest_reachobject no longer means that the mutant isno_coverage. Readstatusfor the status. (#5607) fallow mutationmarks a run that the watchdog stopped. An entry of theattemptsarray now haswatchdog: truewhen the watchdog stopped that run before the runner gave a result. When the watchdog stopped atimeoutmutant in each run, the human output gives aWatchdog:line. A hang or high host load can cause this, so the line tells you to run again with a lower--concurrency. The score does not change. (#5561)- Telemetry shows which entry point of
fallow auditran. The opt-inauditworkflow event has a newaudit_modefield with a fixed value, for examplegateorbrief. It never holds a path, a flag value or a command line. (#5698)
Changed
fallow auditgrades clone instances in CodeClimate and GitHub annotations. Thecodeclimateandgithub-annotationsformats now use the same grade as the audit SARIF output. Underintroduced-clone-group: error, the new copy of a group that counts for the verdict is amajorissue and an::errorannotation. The old copies, and each group that does not count, are aninfoissue and a::noticeannotation. Before, each clone instance was aminorissue and a::warningannotation. A group with the ruleoff, and a saved audit of an older version, keep those grades.fallow report --fromgives the same levels from a saved audit. GitLab Code Quality keeps each issue, because the fingerprints do not change. (#5563)- The refactor advice of a complexity finding names readability as the goal. The
refactor-functionaction now asks for a function that a new reader can follow. Examples are guard clauses, a named predicate or a lookup table. Its note puts tests of the current behavior first and warns against a helper that exists only to pass the threshold.fallow explainand the GitHub annotations give the same advice. The JSON shape does not change. (#5246) - The test advice of a CRAP finding names the commands that find the gaps. The
add-testsnote andfallow explain high-crap-scorenow point tofallow health --coverage-gapsandfallow mutation. Theincrease-coveragenote points tofallow mutation.
Performance
fallow dead-codeis about 2.8 times faster on monorepos with many workspaces. Plugin detection runs beside the parse and reads the workspace config and manifest files in parallel. The analyze, entry point and import resolution stages also do less work for each workspace. On a public monorepo with 205 workspaces and 2,813 source files, a cold run fell from 1.61 s to 0.58 s (median of 9 release-build runs on Apple Silicon). The findings do not change. (#5624)- Follow-up monorepo work trims another ~55 ms from
fallow dead-code. Fallow now reads each workspace manifest and sharedtsconfig.jsononce per pass and shares one peer-dependency lookup cache across workspaces. It also overlaps entry-point discovery with import resolution, runs script analysis beside plugin detection, resolves root plugin configs in one parallel pool job, and stops manifest walks at visited directories. On the same 205-workspace monorepo, this cut about 55 ms of wall time, including about 37 ms in plugin detection across 20 interleaved rounds. (#5699, #5701, #5710) - Shared plugin glob sets cut monorepo peak heap by more than half. Workspaces with identical plugin globs now share one compiled glob set. Matched rules test only excludes instead of compiling a second include regex. On a public monorepo with 205 workspaces and 2,813 source files, regex and glob state fell from 109.3 MB to 10.2 MB (
dhat). Peak heap dropped from 169.3 MB to 96.6 MB (down from 197.4 MB before #5678 and #5679 together), and peak RSS dropped from 298.3 MB to 229.6 MB (down from 328.5 MB). (#5676, #5679) - A run without a security rule does not keep security facts in memory. On a large public monorepo, the peak heap of
fallow dead-codedropped from 204 MB to 125 MB, and peak resident memory dropped by about one fifth. A laterfallow securityrun parses only the files whose cache entry lacks the facts. (#5675) - The first health run on a blobless partial clone no longer stalls in the git churn step. Fallow now fetches the missing file contents of the churn window in one batch request. On a fresh blobless clone of a public library, the churn step dropped from 102.7 s to about 1.0 s across three fresh clones, and the full run dropped from 103.0 s to 1.6 to 1.8 s. A full clone runs no extra git process. (#5623)
fallow mutationdoes not retry a surviving static mutant that ran each covering test. Its first run already ran each test of the files that load the module. When the runner dropped a covering test, the survivor keeps its retry. On a large Vitest monorepo, one such retry took 16 s of a 43 s mutation step. (#5607)
Bug fixes
Detection
fallow dead-codeno longer reports the files that atsc -p <project>script type-checks. Fallow reads the project argument oftscandtsgo. The files of a type-check project in a subdirectory become entry points. A config that builds output, a config in a named package, and a project that includes a path outside its config folder add no entry points. (#5627, #5672, #5673)- A nested project with its own lockfile gets its framework plugins. A folder can have its own
package.jsonand lockfile, up to two levels below the root. When no root workspace pattern declares it, the folder is now an independent project. For example, a documentation site indocs/with its ownyarn.lockno longer givesunused-filefor its pages. To leave such a project out, add it toignorePatterns. (#5625) - A sub-path package with its own
package.jsonkeeps its public API. A rootexportstarget can be themainormodulefile of a nestedpackage.json. When that manifest has asourcefield, Fallow now uses thesourcefile as the public entry. (#5626) - A scoped
usedClassMembersrule also matches a class through its project ancestors.{ "extends": "WorkerHost", "members": ["process"] }now also matches a subclass of a project base class that extendsWorkerHost. The built-in framework rules get the same match. (#5576) Thanks @PedroMartpico for the report, and @1abdala for the first fix in #5712. --unused-class-memberscredits methods called on a new instance through a namespace import. Examples arenew ns.Class().method()andconst w = new ns.Class(); w.method(), also throughexport *barrels. (#5619) Thanks @Suneeth12 for the fix.unused-class-memberreports a class with a named and a default export once. A use through one name now also credits the other name. (#5618)fallow dead-codeno longer reports a root-absolute stylesheet link in a Vue, Svelte, Astro or HTML script block. A server serves a URL such as/custom.cssat runtime. A relativehrefand a scriptsrcmust still resolve. (#5598)--trace-dependencyagrees with the report on credited names independencies. The tooling of an active plugin and an implicit dependency such as an@types/package now trace as"is_used": truewith atooling_credit. (#5250)- Fallow reads the command that
nub exec,nubxandnub runstart. For example,nub exec --node tsc -p types/now gives the entry points oftypes/tsconfig.json. (#5628) unlisted-dependenciesreports a real@docusaurus/package that a file imports. Only the client aliases of@docusaurus/coreand the@theme-init/prefix are virtual modules now. (#5683)- An
overridesentry forcoverage-gapsor acss-*rule now applies to the files that it matches. Before, the override did nothing and gave no message. When the top-level rule isoff, Fallow reports an override ofwarnorerrorasoverride-rule-ineffective. (#5664, #5665) Thanks @michaelevans-carwow for the report of #5664.
Type-aware analysis
- A type-aware run no longer reports a
test-only-exportwhen production code uses the export. The type-aware pass now checkstest-only-exportfindings too, and--test-only-exportsstarts the pass. (#5689) Thanks @Smrtnyk for the report. - A type-aware
--tracenow credits a use that only the checker finds. The trace then givesis_used: true, and thereasonsays that type-aware analysis found the use. (#5690) Thanks @Smrtnyk for the report. - The type-aware sidecar no longer writes "context canceled" to stderr at exit. (#4325)
Security candidates
fallow securityreports a sink that the code calls through an aliased import.import { redirect as go } from "react-router"and a callgo(next)now give areact-router-open-redirectcandidate. (#5597)fallow securityreports a server-only module that client code reaches through a re-export or animport(). A type-only re-export stays clear, and so does animport()that only a React Routerloaderoractionruns. (#5716) Thanks @cr101 for the report.- A same-origin path helper with a
tryblock or anhref()fallback is no longer an open-redirect candidate. Thecatchblock must return a fixed path or throw. (#5714) Thanks @cr101 for the report.
Mutation testing
- A change of a JSON file that a test imports, or of the default snapshot file of the test, now invalidates the stored mutation results. Before, a run after such a change reused each stored result, also when the change made the test fail. A file that a test reads through
fs, and a snapshot path fromresolveSnapshotPath,snapshotResolverortoMatchFileSnapshot, are still not in the key. (#5612, #5666) fallow mutationno longer runs stale code through the compile cache of@babel/register. Before, a warm cache gave each test no covered mutant, and Fallow reported the mutants asno coveragewith no error. Fallow now setsBABEL_DISABLE_CACHE=1for the mutation companion and each process that it starts. (#5549)- Mutation reach selection keeps the returned call of an expression-bodied arrow. A framework such as Elysia reads and awaits the call that an arrow handler returns. The reach probe no longer hides that call. (#5605) Thanks @avidianity for the patch in #5606.
- Mutation reach selection keeps Bun and Node test setup and cleanup probes with their test file. (#5605) Thanks @avidianity for the patch in #5608.
- Mutation reach selection keeps a test file that reaches a function only through a Node child process outside a test. (#5610)
Runs and integrations
fallow auditand the combined run no longer hang with one or two threads. A waiting pool worker now runs pending pool work until its helper thread finishes. (#5668) Thanks @tris203 for the report and the patch in #5670.- The agent gate no longer exits with the jq exit code when jq cannot read the hook input. The gate now prints a notice and exits 0. When the input can hold a git commit or push, strict mode blocks it. A failed
mktempcall follows the same rules. (#5616) - The VS Code extension uses
minimatch11.0.9 andglob14.0.6. These versions fix GHSA-cf2h-pxjq-68xw and GHSA-qxr8-q827-836c. - The help text of the
versioninput of the GitHub Action links to a README section that exists. - The lockfiles use
pin-project-lite0.2.19. Version 0.2.17 was yanked from crates.io.
Upgrade notes
audit.deadCodeBaseline,audit.healthBaselineandaudit.dupesBaselineare deprecated in favor of thebaselinessection.fallow auditandfallow baselines prunestill read them when the matchingbaselineskey is not set, until the next major version. When both keys name different files, Fallow uses thebaselineskey and prints a warning.- The extraction cache, the parse cache and the mutation cache formats change. The first run after the upgrade parses each file again, and the first
fallow mutationrun runs each mutant again. - Run
fallow agent installagain to get the new gate script.
Full Changelog: v3.52.0...v3.53.0