Repository navigation
perf(security): Upgrade to Secretlint v14 and use its built-in recommend preset - #2070
Conversation
…end preset intent(security-check): the security check is one of the slower pipeline stages; Secretlint v14 runs rules only on files that contain a rule keyword decision(secretlint): import presetRecommend from @secretlint/core/builtin and drop @secretlint/secretlint-rule-preset-recommend, which is no longer published from v14 rejected(secretlint): merging the Renovate bump alone — core v14 with the v13 preset package still works but is only 1.3-1.7x faster instead of 6.6-7.8x, and is not a combination upstream supports learned(secretlint): v14 no longer calls performance.mark during lintSource (0 calls for 50 files, 3100 on v13), so the worker's performance.mark override and its type shim are removed learned(secretlint): the v14 CLI applies .gitignore by default, so `--secretlintignore .gitignore` in lint-secretlint is redundant; checked that an ignored file is skipped and a tracked one is still flagged constraint(detection): findings must not change; the same files are flagged on three repositories and on fake credentials for eight providers, and the only difference is one fixed Slack false positive (`xapp-le-kernel`) constraint(dependencies): direct dependencies go 26 -> 25, but the production tree goes 75 -> 76 packages (core v14 adds @textlint/regexp-string-matcher and a nested picomatch) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
⚡ Performance Benchmark
Details
|
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2070 +/- ##
==========================================
+ Coverage 96.22% 96.28% +0.06%
==========================================
Files 139 139
Lines 6309 6304 -5
Branches 1602 1601 -1
==========================================
- Hits 6071 6070 -1
+ Misses 238 234 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review: LGTM 👍The PR is small and does what it says. I checked the main claims against the installed v14 packages and found no blocking issues. DetailsWhat I checked
Nits (optional)
No AI bot inline comments needed triage. |
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Upgrades Secretlint from v13 to v14 and switches to the recommend preset that v14 ships inside
@secretlint/core. The security check gets several times faster; findings are unchanged.Supersedes #2062 (the Renovate bump). That PR only raises the versions, which leaves core v14 running the v13 preset package.
Changes
@secretlint/core,@secretlint/typesandsecretlint:^13.1.0→^14.0.1.securityCheckWorker.tsimportspresetRecommendfrom@secretlint/core/builtin.@secretlint/secretlint-rule-preset-recommendis removed: it is no longer published from v14.performance.markoverride in the worker is removed, together with its type shimsecretlint.d.ts. It existed to neutralize the Secretlint profiler, which v14 no longer triggers duringlintSource(0performance.markcalls for 50 files; 3,100 on v13).lint-secretlintdrops--secretlintignore .gitignore. The v14 CLI applies.gitignoreby default.Why the import matters
v14's speedup comes from rules declaring keywords: a file without any keyword is skipped without running a rule. That only works with the rules built into v14.
lintSource()per file, the way the worker calls it, single thread:End to end
node bin/repomix.cjs <repo>, mean of 10 runs:The wall-time cost of the security check itself drops from 55 / 301 / 119ms to 13 / 88 / 35ms.
All timings were taken on a Mac in low power mode, before and after under the same conditions. Absolute numbers will be lower in normal mode; the unchanged
--no-security-checkcolumn shows the comparison is clean.Findings are unchanged
xapp-le-kernelis no longer reported as a Slack token (fixed upstream in 14.0.1).lint-secretlintwas checked both with and without the removed flag: a secret in a git-ignored file is skipped, a secret in a tracked location fails the lint.Dependencies
@textlint/regexp-string-matcherand a nestedpicomatch, which is one more than the preset package it replaces.package-lock.jsonshrinks by about 650 lines, mostly from thesecretlintCLI (dev dependency).Not in this PR
The security worker count was tuned in #2052 against v13's cost. With the check this much cheaper, fewer workers may now be optimal; that needs its own measurement.
Checklist
npm run testnpm run lintNote on lint: my local Biome install is older than
package.jsonrequires, so I ran Biome 2.6.8 on the changed files vianpx, and oxlint,tscand secretlint through the regular scripts.🤖 Generated with Claude Code