Repository navigation
chore(deps): update dependency fallow to v3.44.0 - #998
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #998 +/- ##
=======================================
Coverage 94.91% 94.91%
=======================================
Files 10 10
Lines 747 747
Branches 235 235
=======================================
Hits 709 709
Misses 35 35
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
3.43.2→3.44.0Release Notes
fallow-rs/fallow (fallow)
v3.44.0Compare Source
Added
Production mode reports a test pattern that drops a file that production code imports.
A built-in production pattern such as
**/test/**also matches productionsource, for example
src/components/runner/test/Runner.vue. Fallow does notanalyze that file, so an export or a parameter that only this file uses can
appear in a finding. When a production file imports such a file,
workspace_diagnostics[]now carries oneproduction-excluded-file-importedentry for each pattern, with
pattern,file_countand the first fivefiles. An import of a workspace package whose entry file such a patternexcludes counts too. The human output prints the same warning on stderr. The production
patterns do not change. To analyze the file, move it out of the matched path,
or run that analysis without production mode (
--no-productionorproduction: { deadCode: false }).(Closes #4498)
duplicates.normalization.consistentIdentifiersfinds renamed copies without false matches. Use it together withignoreIdentifiers. A clone then needs a one-to-one mapping between the names of its instances:a = b + cmatchesx = y + z, but notx = x + x. When a token breaks the mapping, fallow keeps each longest part of the clone that maps one-to-one and hasminTokensor more tokens. An instance that breaks the mapping does not shorten the clone of the other instances. The option is off by default, and nomodeturns it on.fallow migratenow maps theignoreIdentifiersandignoreLiteralsoptions of an imported duplication config, and keeps string values compared when an importedweakmode did not ignore literals. Thanks @neumaennl for the report. (Closes #4626)New rule
unused-protected-class-membersreportsprotectedclass members that no code reads. The rule isoffby default, so the default output does not change. A protected member is used when its class or a subclass reads it throughthisorsuper. A subclass override is used when the base class calls the member. Classes of the public API of a package are not checked, because a consumer can subclass them. Production mode ignores reads in test files, as for public members. Turn the rule on inrules, select it with--unused-protected-class-members, and suppress one finding with// fallow-ignore-next-line unused-protected-class-member. The findings go to the newunused_protected_class_membersarray in JSON and reach SARIF, CodeClimate, the human report, the LSP andfallow explain.unused-class-membersstill does not report protected members. A finding on a run with an incomplete import graph carriesreachability_caveats[]. Eleven arrays carry it:unused_protected_class_members[]joins the ten arrays that carried it before. Known limits: a read through a string key (this["member"]()) gives no credit, as for public members, and the rule does not check a constructor parameter property (constructor(protected readonly x: X)). AnignoreDecoratorspattern that matches only protected members no longer gets the warning for an unmatched pattern. The extraction cache version and the graph cache version change, so the first run after the upgrade parses every file again.Thanks @neumaennl for the report. (Closes #4624)
production.ignoredrops paths from discovery in production mode only.The object form of
productionacceptsignore, an array ofproject-root-relative globs, for example
"production": { "deadCode": true, "ignore": ["scripts/**"] }. A run inproduction mode excludes these paths, in addition to the built-in test,
spec, story and dev patterns. The default run keeps them. The globs apply to
each analysis that runs in production mode, also when
--productionor aFALLOW_PRODUCTION*variable selects the mode. The boolean form ofproductiondoes not change.Thanks @cr101 for the report. (Closes #4622)
client-server-leaknow checks React Router Framework Mode apps. React Router code has no"use client"directive, so the rule had no starting point in such an app. When the React Router plugin is active, route modules (root.tsxincluded) are client roots. A route module is a file that the route config names, the root route, or a route file of the route directory. A helper next to aroute.*file and a test file are not roots. Only the code that React Router keeps in the client build counts: an import, a re-export or aprocess.env.X/import.meta.env.Xread that onlyloader,action,middlewareorheadersuse is not followed. This also applies to a route module that another module imports. A secret read in the route component itself is reported. An env read in another form, such asconst { X } = process.env, counts for the whole route module. Files named*.client.*or under a.client/directory are client roots, and files named*.server.*or under a.server/directory areserver-only-importsinks, in the packages where the plugin is active. Such an app no longer gets theclient-server-leak-no-client-rootsdiagnostic.Thanks @cr101 for the report. (Closes #4582)
circularDependencies.allowaccepts exact cycles. Each entry lists the files of one cycle in import order, relative to the project root, for example[["src/a.ts", "src/b.ts"]]. An entry accepts only the cycle with exactly these files, from any start file. A new cycle through the same imports stays reported, which an inlinefallow-ignore-next-line circular-dependencymarker does not give. Paths are case-sensitive. An entry needs at least 2 files and lists each file once. An accepted cycle does not count toward the limit of 20 listed cycles per group of files that import each other. An entry that matches no cycle gives acircular-dependencies-allow-unmatcheddiagnostic in JSON, SARIF, Markdown and the stderr note. An entry that the detector cannot check (more than 12 files, or all files in a group that reached the limit) gives no diagnostic. Afallow-ignore-next-line circular-dependencycomment on an accepted cycle becomes a stale suppression, so remove it when you add the entry.fallow migratenow translates thecycles.allowlist of a migrated config. Thanks @cr101 for the report. (Closes #4623)fallow auditcan fail on a new clone group. The new ruleintroduced-clone-group(error,warnoroff) sets how a clone group takes part in the audit verdict and exit code. The default iswarn, so the verdict does not change for current configs. Witherror, a clone group that the change introduces fails the audit with exit code 1. Withoff, the group stays in the report but does not change the verdict. Under--gate new-only, an inherited clone group never gates. Under--gate all, every clone group in the changed files follows the rule. Withoverrides, the rule resolves for the file of each copy, and the most severe result applies. So an override cannot exempt a clone group that has a copy outside the override. For generated code, useduplicates.ignoreorignorePatterns.duplicates.thresholddoes not change and can still fail the run.fallow explain introduced-clone-groupdescribes the rule.Thanks @cr101 for the report. (Closes #4658)
fallow fixreports each export that a kept re-export holds back.fixno longer removes theexportof a declaration while a re-export that it keeps still names that declaration. A re-export stays, for example, in a file thatfixskips as low confidence, in a file whose namesignoreExportshides, or in a list statement that has no safe text edit. Each withheld removal is aremove_exportentry withskip_reason: "kept_re_export". The new JSON counterskipped_kept_re_exportscounts these entries, and the human output and the CI step summary state them. The exit code does not change. Limit: a file thatignorePatternsexcludes is not in the module graph, so a re-export in such a file cannot hold a removal back. Run the type check afterfallow fixwhen an ignored file re-exports project code.(Refs #4636)
fallow type-aware setupinstalls the type-aware companion for a binary that did not come from npm. A Homebrew,cargo installor release-archive binary on macOS or Linux now gets the companion with one command. The command asks Node for its platform and architecture, downloads the bundle of its own version from the GitHub release, and checks the signature with the release key that the binary holds before it unpacks. The bundle goes into a versioned user directory, and Fallow checks that directory afterFALLOW_TYPE_AWARE_BINand the sibling of the executable.--from <file>installs a copied bundle on a machine with no route to GitHub. The download honorsHTTPS_PROXY,HTTP_PROXY,NO_PROXYandFALLOW_CA_BUNDLE.fallow type-aware cleanupremoves the companions of other versions. The first bundles appear with the release that contains this change.type-aware statusreportsdiscovery_source: "setup-directory"for such a companion.(Closes #4630)
fallow-ignore-startandfallow-ignore-endsuppress one clone. Put// fallow-ignore-start code-duplication -- <reason>above a block and// fallow-ignore-end code-duplicationbelow it. A clone inside the range is not reported. A clone that reaches into the range is cut at the range border, and a cut part belowminTokensorminLinesis not reported. The/* */, JSDoc and<!-- -->forms work too, each on its own line. A marker in a string or template literal does not count. Ranges support onlycode-duplication.fallow dupesandfallow auditreport a range marker with a problem (an end with no start, a nested start, a start with no end, no kind, another kind, or a marker that shares its line with code) in the newrange_marker_problemsarray, and such a marker has no effect.fallow suppressionslists ranges withlevel: "range"andend_line. Clone groups get asuppress-rangeaction next tosuppress-line. A missing reason on a range start showsis_range: truein its suppression origin. A range cuts its neighbor clones, so a baseline gate can show a cut clone as new, and itsignoredCloneskey changes: save the baseline again after you add a range. The duplication token cache and the extraction cache are rebuilt once after the upgrade.Thanks @neumaennl for the report. (Closes #4706)
A boundary zone can list its public entry files with
publicFiles. Since 3.31.0, the boundary check follows a named or default import through re-export chains and judges it by the file that declares the symbol. That made the one-public-entry-file pattern (for examplesrc/modules/billing/index.ts) report every import through the entry file. Now a zone can set"publicFiles": ["src/modules/billing/index.ts"]. A file of another zone may then import only those files of the zone, and the chain walk stops at a public entry file. A deep import that a rule allows gets a finding withreason: "internal_file"andpublic_files, which names the files to import instead. On anautoDiscoverzone, each glob is relative to each discovered folder, so"publicFiles": ["index.ts"]gives each module its own entry file. The output omitsreasonfor a zone-rule finding, so a project withoutpublicFilesgets the same output as before.fallow list --boundaries --format jsonshows thepublic_filesglobs of a zone. Thanks @robertrguerrero for the report. (Closes #4760)fallow mutationcan select Vitest projects with--runner-project. A root Vitest config can hold projects from separate config files, such as browser or server projects. The mutation companion cannot instrument those projects, so the run failed at setup even when the tests of interest were in an inline project. Now--runner-project <name>, which you can repeat, or themutation.runnerProjectsconfig key selects projects as the Vitest--projectflag does, wildcards included. Each project that is not selected stays out of the run. A selected project from a separate config file still fails at setup, and a name that matches no project fails with the Vitest message. With a runner other than Vitest, a selection exits with code 2. Thanks @michalius for the report. (Closes #4785)Changed
fallow audit --quietnow prints only the actionable part of the human, compact and markdown reports. This is a behavior change for existing--quietusers. Before,--quietremoved only the progress output. Now the report also drops unchanged inherited findings, aggregate metrics (vital signs, health score, hotspots and other ranked lists) and thestaleandactiverecords ofhealth.thresholdOverrides. The report keeps introduced and worsened findings, diff-risk findings, configuration errors, analysis failures, warnings about incomplete analysis, and theinsufficientandno_matchoverride records.FALLOW_QUIET=1, or--ciwith an explicit--format human,--format compactor--format markdown, also sets quiet and gets this view.--cialone prints SARIF, which keeps the complete report. A script that setsFALLOW_QUIET=1and posts the output offallow audit --format markdownno longer gets the inherited context. The verdict, the exit code and the JSON, SARIF, CodeClimate, review and GitHub formats do not change. Run without--quiet, or use--format json, for the complete report.Thanks @Fidasek009 for the report. (Closes #4575)
fallow dupesnow compares the static text of template literals. Before, every template literal matched every other template literal. Now the text outside the${...}expressions must match, as for string literals. Escapes compare by their value, so`\x41`matches`A`. Thus code that differs only in template text is no longer a clone, and default results can show fewer clone groups. Setnormalization.ignoreStringValues: true, or usemode: "weak"or"semantic", to match template literals with different text again. (#4626)The VS Code and Cursor extension shows one Fallow status bar item instead of up to five. The item shows the finding count and the health grade, for example
Fallow 9 · C. Its hover shows the issue breakdown, duplication, health, the audit verdict, the license state, the active workspace and whether findings are visible in the editor. A click opens a menu to run the analysis, hide or show findings, run the audit, switch the workspace, or open the settings. The item gets an error background when the audit fails. When all findings are hidden in the editor, the item keeps a closed-eye icon, also next to an audit or progress icon. The separate workspace, audit, license and eye items are gone. All commands keep their ids, and the newFallow: Show Status Menucommand opens the menu.The Fallow status bar item shows a license only when it needs action. The item text shows the license when it expires within 14 days, has expired, or is not valid. When the license is past its grace window (paid features are blocked), the item also gets a warning background. A failed audit keeps the error background, also when the license is blocked. An expired license that still works shows the notice without a background. License material that the CLI cannot read, for example a stale
FALLOW_LICENSEvalue, now shows "license invalid" with a warning icon. Before, the extension hid it. The hover shows the tier, the seats, the features and the expiry, and it offers a refresh when the CLI suggests one.fallow migratemaps production exclusions toproduction.ignore.A
!pattern!entry in aprojectsetting of the migrated config, at theroot or in a workspace, becomes a
production.ignoreglob. Before,fallow migratedropped these entries and suggested an
overridesentry, which hid thefindings in every mode.
fallow mutation --kill-matrix-forruns the target tests first and stops when no target kills the mutant. Such a mutant now gets the new statusnot_killed_by_target. It runs no other covering test and gets no survivor retry. After a target kill, the other covering tests run fastest first up to the first kill. Only a kill by exactly one target test and no other test gets a retry, so one flaky run cannot make a test look necessary. A retry that does not kill again with the same tests makes the mutantflaky. For deterministic tests, each target keeps the samekills,unique_killsandtarget_only_kills, with fewer test runs. This mode has no score:summary.scoreisnull, and--min-scoreexits 2.--kill-matrix-fullkeeps the earlier behavior, in which each mutant gets a normal status and the run has a score.kill_matrix.target_modenames the mode (target-firstorfull). Thanks @cr101 for the report. (Closes #4588)A type-aware companion of another Fallow release stays valid while it speaks the same wire protocol. Fallow compared the companion package version with its own version, so each upgrade needed a new companion. It now compares only the wire protocol version, so a companion stays in use until the protocol changes. The wire protocol is now 8, because the format changed three times at version 7. A CI check now ties the version to a hash of the wire contract, so a format change cannot ship at the old version. Companions of earlier releases are not accepted: such a companion refuses the request, and the error then names
fallow type-aware setupand the npm install. The npm launcher still selects the companion of the exact version.Bursts of merges to
mainstart fewer CI runs. The push runs of CI onmainnow share one concurrency group. A started run always finishes, and a newer push replaces a run that waits in the queue. The release commit keeps a group of its own, so the release gate always gets a result for it. The prose-only skip onmainnow also checks that the push run of the previous commit succeeded, because a replaced run leaves that commit without a result. This change affects contributors only.Pull request checks finish sooner. The Rust CodeQL analysis takes about 20 minutes and ran longer than CI on most pull requests. It now runs on pushes to
mainand on the weekly schedule. A pull request analyzes Rust only when it changes the CodeQL configuration. The JavaScript and TypeScript analysis and the Actions analysis still run on each pull request. Onmain, a newer push replaces a queued analysis, and a started analysis always finishes. This change affects contributors only.PGO Validate skips pull requests that cannot change a PGO build. The workflow starts for each edit of
Cargo.tomlorrelease.yml, and its comparison takes more than an hour on a macOS runner. A version bump, a dependency entry, a lint or a publish job change now skips the comparison. A change of a release profile section, of the top-levelenvofrelease.yml, or of the release jobs that train and use the profile, still runs it. The weekly run onmainstill covers dependency changes. This change affects contributors only.The Rust structure checks use cargo-fallow 0.4.0. The
Rust StructureCI job andmise.tomlpin the same release. The baseline no longer holds three complexity entries for functions that are now under the limits. This change affects contributors only.Pull request CI finishes sooner. Nextest starts tests in binary and name order, so a slow test that sorts late ran alone at the end of a CI test partition, and the partition waited for it. The
cinextest profile now starts the tests that take 25 seconds or more first. This change affects contributors only.Pull request jobs miss the Rust cache less often. The repository uses more than the GitHub cache limit, so GitHub evicts the oldest caches within hours. Daily and weekly workflows saved large Rust caches that were gone before their next run and evicted the caches that pull request jobs restore. Workflows without a push trigger now restore a cache but do not save one, and the weekly release validation run saves nothing. PGO Validate no longer caches its fixtures of about 0.9 GB. Releases keep their caches. This change affects contributors only.
Rust pull requests get their CI result sooner. The nextest suite now runs in three
Checkjobs instead of two. Each job still builds every test binary, but it runs a third of the tests, so the slowestCheckjob, the last job of most pull request runs, finishes earlier. The same tests run. This change affects contributors only.One rule now decides whether a run executes the duplication analysis. A run that names the analysis executes it. Without a name, the config key of the command decides (
audit.dupes), and without that keyduplicates.enableddecides. The barefallowcommand,fallow audit,fallow_api::run_audit,fallow_api::run_combined, the language server and the health score all use this rule.The maintainer plugin reference lists the Playwright config parsing and the correct plugin count. Thanks @VariableVince for the report. (Closes #4710)
The sticky PR comment states the verdict first, then the counts, then the details. The verdict line is followed by the counts per severity (
19 findings: 4 errors, 15 warnings) and the gate line, before the finding tables. The gate line no longer comes after the footer. Each rule id links to its docs page, the location is one code span (src/a.ts:12), and the severity column useserrorandwarning, the same words as the review comments and the annotations.The gate line and the request line are shorter.
Gate outcomes: failed error-severity-findings (3 at or above error) (none of which fails this run)now readsGates: failed error-severity-findings (3 at or above error). The job status states whether the run failed. The request line appears only when a request did not apply or applied over an empty scope.Inline review comments are easier to read.
Other locations:is nowAlso in:, a one-line range readssrc/a.ts:3and notsrc/a.ts:3-3,> Fix intent:is now**Fix:**, and the review body no longer repeats the mutation result in one line before the mutation section.Duplicate code findings name the size of the clone. The CodeClimate description
Code clone dup:7308a6eb (14 lines, 2 instances)is now14 lines repeat in 2 places (clone group dup:7308a6eb).The mutation section uses plain words. A partial run names its reason in words (
the run reached its time budget), a survived mutant description puts the code in code spans (Changing `>=` to `>` in `isAdult`), the count table leaves out theNot measuredcolumn when it is 0, and the section no longer saysScope: the changed lines.for the default scope.The sticky PR comment puts the verdict in its heading. The heading is now
Quality gate failed,Review neededorQuality gate passed, and the line under it names the report and the counts, for exampleFallow combined report, 19 findings: 4 errors, 15 warnings.A reader who scans the pull request timeline sees the result first.The mutation section of the PR comment and the review is two lines until a reader opens it. The partial-run line and the headline (
12 mutants survived. Score 14.2%.) stay visible. The count table, the explanation, the lines without tests and the inspect command move into oneCounts and detailsblock. The job summary keeps every paragraph open.A run with nothing to say says less. The PR comment and the review leave out the mutation section when no mutant was in scope. A passed gate names no measured value (
Gates: passed error-severity-findings, health-findings.). A change scope that applied over an empty scope readsNo changed file has code that fallow analyzes. Check the diff or the base ref of this run., and another narrowing request, such as a group selector, readsgroup-filter left nothing to analyze.Deprecated
fallow.diagnostics.statusBarsetting has no effect. It controlled the separate eye button, which is gone. Use Hide findings in the editor in the menu of the Fallow status bar item, or theFallow: Toggle Hide All Findingscommand.Fixed
The GitLab CI template keeps the mutation results when the job fails. GitLab saves a job cache only after a successful job by default. A survived mutant or another error finding fails the job, so the job lost
.fallow/mutation/results.json, and the next pipeline started the mutation run again from the start. A run that stopped at its time budget could then never continue. The template now saves the.fallowcache also when the job fails, the same as the GitHub Action saves its mutation cache. The mutation step also writes its cache stamp before the run, so the next run keeps the results of a job that stopped during the run.(Refs #4383)
On Windows, the React Router
.clientand.servermarkers now apply in a workspace package.client-server-leakread a workspace package with the React Router plugin as out of scope, because its scope kept the backslashes of the Windows path. A*.client.*file in such a package was then no client root, and a*.server.*file was noserver-only-importsink. A root project and macOS and Linux were not affected.Imports in an inline HTML script are now in the graph. Fallow parses each inline script body that the browser runs. A module script gives static and dynamic imports, and a classic script gives dynamic imports. A package or a module that only an inline module script imports is no longer reported as unused. A script with a
srcattribute or a data type (JSON, import map, template) is not parsed, and a template placeholder such as{{ STATIC_URL }}in a specifier is skipped. (Closes #4728)An
htmltagged template of a local tag no longer gives unresolved imports. When a module bindshtmlitself, for exampleexport const html = String.raw, or imports it from a relative path, fallow reads its templates as plain text. A tag from a package such aslitorhono/htmlstill gives asset imports. An unresolved asset of anhtmltemplate now points at itssrcorhrefvalue, not at line 1, column 0. (Closes #4729, #4730)The weekly fuzz smoke run completes inside its time limit. The scheduled run fuzzes each target for 300 seconds, one after the other, so it needs about 67 minutes. The job limit for a scheduled run is now 90 minutes. A push run keeps the 45-minute limit. A policy test checks that the job limit covers the fuzz time of all targets for each event. This change affects contributors only.
(Closes #4619)
fallow mutationruns one Vitest worker in each companion whenVITEST_MAX_WORKERSis set. Vitest appliesVITEST_MAX_WORKERSafter the config options. An inherited value thus replaced themaxWorkers: 1of the companion, and each companion started that many workers. With the default--concurrency, this multiplied the CPU and memory use. The Vitest companion now removes the variable before it starts Vitest, so--concurrencyis the only control of test parallelism.Thanks @DannyStreur for the report. (Closes #4613)
constant-parameterfollows a loaded value through??,||and a ternary. Code such asconst api = mod.default ?? mod; api.migrate()on a value fromimport(path)was an escape, so the rule skipped each exported function of the project. The rule now reads the result of the fallback when each branch is the loaded value or one member of it, and skips only the exported functions with a name that the code reads. Anawaitof the loaded value also keeps it. A branch with any other value is still an escape. The extraction cache version goes up, so the first run after the update parses each file again.(Closes #4594)
The VS Code extension opens the Settings editor in a way that cannot freeze it in Cursor. In Cursor,
workbench.action.openSettingswith a search query can freeze the Settings editor. These actions now run that command throughrunCommands:Fallow: Open Settingscommandfallow-lspis missingSet Baseline at HEADThe Settings editor opens with the same query, and no result goes back to the extension. If the Settings editor does not open, a warning names the setting to search for. In VS Code, the actions do not change. (Closes #4595)
A missing type-aware sidecar no longer fails the gate on findings that the type-aware pass can disprove. With
typeAware.enabled: true,typeAware.require: best-effort(the default), and nofallow-type-awaresidecar,dead-code,auditand the bare run reportunused-export,unused-type,unused-class-memberandprivate-type-leakfindings atwarn, also under--fail-on-issuesand--ci. Every otherwarnrule is still raised toerrorby these flags. Before, a Homebrew orcargo installbinary reported these findings aterrorand exited 1, for example on a class method that only the type-aware pass sees as used._meta.type_aware.executedstaysfalse, the warning stays, andgate_outcomesgets atype-aware-fallbackentry withstatus: skipped. A sidecar that starts and then fails or times out keeps the configured severities, andrequire: completestill exits 2. (Closes #4606)The Playwright plugin reads a
reporter,globalSetuporglobalTeardownvalue that a condition picks. A config such asglobalSetup: external ? undefined : './setup.ts'madefallow dead-codereport the setup and reporter files as unused. The plugin now reads each branch ofa ? x : y, and the operands ofa || xanda ?? x. AglobalSetuparray also gives each of its files. A template literal without expressions, such as`./setup.ts`, still counts.Thanks @cr101 for the report. (Closes #4620)
With
includeEntryExports, the default export of a Playwright reporter,globalSetuporglobalTeardownfile counts as used. Playwright loads these files from the config and reads their default export. The credit also covers the TypeScript source of an ESM specifier, such asreporter.tsfor./reporter.js. Other exports of these files stay reported.Thanks @cr101 for the report. (Closes #4621)
A module-scope member read no longer credits a class binding of a function body. In
function setup() { const Alias = new Foo(); }with a module-scopeconst Alias = E; Alias.One, the readAlias.Onealso creditedFoo.One. The read now resolves only through the module-scope binding, sounused-class-membersreportsFoo.OneandE.Onestays credited. The order of the read and the function does not change the result. (Closes #4603)fallow securityno longer reports a call of an inert local function as a library sink. Some rows match a callee by name only, for examplerequest(url)forssrfandx.merge(a, b)forprototype-pollution. When the module declares that function, or an object literal with that inline method, and its body runs no call and writes no member, the call cannot reach the library. The call is then not a candidate. A local function that runs a call still matches by name, because it can forward its argument to the library. When the module reassigns the function anywhere (request = got), writes a member of the object (utils.merge = _.merge), or passes the object to a call (Object.assign(utils, ...)), the call also stays a candidate. (Part of #4611)A type read through a namespace import of a JS module credits its declaration file. With
import * as lib from "./lib.mjs"and the type referencelib.HelperOpts, the exportHelperOptsof the siblinglib.d.mtsno longer reports as an unused type underincludeEntryExports. AusedExportsrule of a framework plugin on the pathlib.mjsnow also credits that export inlib.d.mts. The same applies to a.jsmodule with.d.tsand a.cjsmodule with.d.cts. (Closes #4551)fallow health --csscredits declarations in nested CSS blocks. Withnative CSS nesting, these declarations now count:
@media,@supports,@container,@layer,@scopeor@starting-styleblock inside a style rule;.a { &:hover {} color: red; }.A
@keyframesor a font family that only these declarations use is nolonger reported as unreferenced. A rule with only such declarations no
longer counts as empty. The totals of declarations and
!importantdeclarations now include these declarations. They also feed the raw style
values, the design-token counts and the custom-property definitions, so an
upgrade can show new findings for them.
Thanks @Smrtnyk for the report. (Closes #4612)
hardcoded-secretno longer reports sentences and public URLs. The entropy check now skips a value of three or more words with no token-shaped word, such as an error message or a SQL statement under a key that containstokenorcredential. It also skips anhttporhttpsURL without user information, a query, a fragment or a high-entropy path piece, such as an OAuth token endpoint or a help link. A header value such asAuthorization: Bearer <token>, a URL withuser:pass@or a?token=query, and a webhook URL with a secret path piece stay candidates. Provider token shapes do not use these filters. Thanks @Smrtnyk for the report. (Closes #4610)unused-class-membersfollows a Durable Object binding of the WorkerEnv. A method call on a Durable Object stub now credits the method of the Durable Object class. The stub can come from theenvimport ofcloudflare:workers, or fromthis.envin a class that extendsDurableObject<Env>,WorkerEntrypoint<Env>orWorkflowEntrypoint<Env>. An inline call such asenv.ROOM.getByName(name).join()also gives credit. Fallow reads the binding types from theworker-configuration.d.tsfile thatwrangler typeswrites. In a monorepo, each Worker package uses the nearest of these files. A stub at the top level of a module gives no credit yet. The extraction cache version goes to 448.(Closes #4548)
test-only-dependenciescounts the test files that a test runner config selects. A Vitestinclude, a JesttestMatchor a PlaywrighttestDircan name test files that the built-in name patterns do not match, such as*.vitest.ts. The rule treated these files as production code, so a package that only they import stayed independencieswithout a finding. A test entry point of a test runner now counts as a test file, unless a runtime entry point or a support entry point, such as a file that a package.json script runs, reaches it. Aframeworkentry with"entryPointRole": "test"also counts.Thanks @okize for the report. (Closes #4618)
command-injectionreports an untrusted argument ofspawnandexecFilewith the shell option on. Withshell: trueor a shell path, Node joins the command and the arguments into one shell command line, so the shell also parses each argument. A call ofspawn,spawnSync,execFileorexecFileSyncfromnode:child_processis now a candidate when its options object literal turns the shell on and its argument array holds untrusted input, for examplespawn("git", [req.query.ref], { shell: true }). An options variable or an options object with a spread does not prove the shell option, so these calls stay out. An options object in the argument position is not an argument array, and aspawncall with a non-literal command gives one candidate, not two. (Closes #4550, closes #4549)A small
.jsfile with JSX and a CommonJS file with a top-levelreturnnow parse without errors. The JSX retry parse now also runs for a file of
100 bytes or less when the first parse reports an error. A top-level
returnis now valid in a.js,.jsx,.tsor.tsxfile, becauseNode.js wraps a CommonJS module in a function. Fallow no longer marks these
files as
source-parse-degraded, and their imports, exports and calls nowcount.
(Closes #4497)
The Git hooks and the agent gate now run the project-local fallow first. The pre-commit hook of
fallow init --hooks, the Lefthook job and the gate offallow agent installnow try./node_modules/.bin/fallowbefore afallowonPATH. The project pins its fallow version, and a global install can have another version or no type-aware companion. The order is now the same as the order of the plugin gate.fallow agent statusreportsgate-path-versiononly when the project has nonode_modules/.bin/fallow, because only then does the gate run thefallowonPATH. A project that pins an old fallow now runs that version in its hooks. The Git hook needs fallow 3.43.0 or later foraudit --staged, and it names the runner and the fix when the version is older. The agent gate names the devDependency or the install onPATH, whichever it ran. Installed hooks keep the old order until you refresh them: runfallow hooks install --target git --forcefor the Git hook, copy the job thatfallow hooks install --target gitprints intolefthook.ymlfor a Lefthook job, and runfallow agent installfor the agent gate (fallow agent statusreports an old gate script asstalewith thegate-script-refreshaction). (Closes #4628)fallow dead-codeno longer reports the Cloudflare Workers runtime handlers as unused class members. The runtime calls these methods by name, so no project code calls them. A class that extends a base class ofcloudflare:workersnow gets credit for the handlers that the base class declares in@cloudflare/workers-types:alarm,fetch,connect,webSocketMessage,webSocketCloseandwebSocketErroronDurableObject;email,fetch,connect,queue,scheduled,tail,tailStream,testandtraceonWorkerEntrypoint;runonWorkflowEntrypoint. The base can come from a named import or a namespace import (cf.DurableObject). A subclass gets the same credit through a chain of local base classes, also when the module does not export a base class or a base class is generic. A default export and a renamed export (export { Room as ChatRoom }) get the credit too. A base class with the same name from another module gets no credit, and other methods stay reported. Known limit: astaticmethod with a handler name also gets credit, although the runtime calls only instance methods.(Closes #4649)
fallow dead-codecredits a Durable Object method that a Worker handler calls through its untypedenvparameter. In an object of the typeExportedHandler<Env>(throughsatisfies,asor a variable annotation), the second parameter of a handler such asfetchorqueuenow has the typeEnv. A stub call such asenv.ROOM.get(id).sayHello()then creditssayHelloon the Durable Object class of the binding. Known limits: the type nameExportedHandlermatches without a check for a local type of the same name, and a handler that names a separate function ({ fetch }) gets noenvtype. The extraction cache version changes, so the first run after the upgrade parses every file again.fallow fixnow removes unused names from an export list that spans several lines. A formatter puts each name of a longexport { ... } fromlist on its own line.fixremoved theexportof the source declaration but kept the list, so the type check of the fixed code failed with TS2459.fixnow removes the unused names from the list and keeps the layout, comments and trailing commas of the names that stay. It also removes a comment line above a removed name when no kept name follows that comment. It deletes the full statement when no name is left. It also removes an aliased name such asexport { a as b }by its exported name.Thanks @MikeSpock for the report. (Closes #4636)
fallow securityno longer reports a call of a shallow-safe project function as a library sink. Some rows match a callee by name only, for examplerequest(url)forssrfandmerge(a, b)forprototype-pollution. When a module imports that function directly from another project file (a named, aliased or defaultimport), the analysis now reads the body of the function in that file. A body is shallow-safe when it calls only shallowObjectbuiltins such asObject.assign({}, ...),Object.keysorObject.entries, and writes a member only one level deep on an object that the function creates. The call is then not a candidate. The same check now also applies to a local function, so a shallow copy such asconst copy = Object.assign({}, obj); copy[k] = vno longer keeps the call of it. A recursive merge, a write to a parameter, a write two levels deep,fetchor any other call keep the candidate. A function from an external package, a re-export chain and a namespace import (utils.merge()) also stay candidates. Thanks @Smrtnyk for the report. (Closes #4611)fallow auditno longer reports a complexity finding as introduced when a refactor moves the function to another file. Under--gate new-only, a complexity finding matches its base finding by file path and function name. A refactor that splits one file into several files gave each moved function a new path, so the audit reported the function asintroducedand the gate failed for code that the change did not write. A finding without a base finding now takes the base finding of the same function name from another changed or deleted file. A moved function with equal values isinherited. A function that grew and moved out of a deleted file isworsened. A function that grew and moved out of a file that still exists staysintroduced, because the audit cannot tell it from a new function of the same name. When two or more functions of one name moved and their values changed, the name does not identify them, and they stayintroduced. A whole-file rename already kept its findings inherited.fallow auditreports a rule severity that a change makes less strict. A change to the Fallow config file at the analysis root that lowers a rule severity now gives aweakened-testsfinding withkind: "rule-severity". Examples areerrortowarn,warntooff, a removed rule whose default is weaker, a newoverridesentry that turns a rule off for some paths, and a new or deleted config file. A new config compares with the default severities. The finding takes the stricter of the base and the headweakened-testsseverity. Thus a change that setsweakened-teststooffand addsit.skipno longer passes the audit. The head config still sets the severities of all other findings. The audit brief shows the finding as athreshold-loweredsignal.(Closes #4668)
fallow auditreads the full config chain for a less strict config. Theweakened-testscheck of the Fallow config now finds the config file the same way as the loader, from the analysis root up to the git root. It follows each relativeextendsfile at the base and at the head. A lower rule severity in an extended file, or a removedextendsentry, now gives arule-severityfinding on the changed file. A value that annpm:package or anhttps://URL can set does not compare, because the audit cannot read it at the base. A rule that moves between config files with the same severity gives no finding. A finding on a config file in a parent directory of the root has a path that starts with../, and the GitHub and GitLab output resolve it against the repository prefix.fallow auditreports a new ignore entry in the Fallow config. A new or broaderignorePatternsorignoreFindingsentry, or a removed!exception, now gives aweakened-testsfinding with the new kindignore-pattern. AnignoreFindingslist that changes to only!entries also reports, because it hides every other path. A removed or narrower entry, or an entry that a built-in default already covers, gives no finding. The finding takes the stricter of the base and the headweakened-testsseverity, and a head suppression comment does not hide it. The audiConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.