🍕 Fix normalizeRequestedSteps complexity regression from #259 - #262
Merged
Merged
Conversation
`npx eslint lib cli index.js` -- the full lint command `npm test` actually runs -- currently fails on master: normalizeRequestedSteps has a cyclomatic complexity of 10 (max 8), introduced in #259 and missed there because that PR's own verification only linted the specific files it touched, not the full repo command. Master is broken for `npm test` right now as a result. Splits the function into splitOnlyEntries() (CSV/repeated-flag parsing) and classifyOnlyEntries() (recognized vs. unrecognized step names), leaving normalizeRequestedSteps as a thin orchestrator (complexity 7). No behavior change -- reverified the exact case #259 added: an unrecognized --only value still throws with the same message. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
TL;DR — for reviewers short on time
npm test(the lint step specifically):normalizeRequestedStepsinlib/cmd/vite/scripts.jshas a cyclomatic complexity of 10 against a max of 8, introduced by 🍕 --only correctness: error on typos, log implicit deps and CSS writes #259 and missed there because that PR's own lint check only covered the specific files it touched, not the fulleslint lib cli index.jscommandnpm testactually runs. This is a pure refactor — splits one function into three, no behavior change.--only, throwing on an unrecognized step name) is unchanged and reverified.npm test(lint + all 456 tests, including 🍕 Share and validate the Kiln-plugin PostCSS chain across both pipelines #258/🍕 --only correctness: error on typos, log implicit deps and CSS writes #259/🍕 Harden browser-compat stubs: string_decoder, url, node: import-safety #254's now-merged coverage) green — it was failing on master before this PR. Manually reverified the exact case 🍕 --only correctness: error on typos, log implicit deps and CSS writes #259 added:build({ only: ['stylez'] })still rejects with the same message.lib/cmd/vite/scripts.jsL60–L107 — the whole change.splitOnlyEntries()andclassifyOnlyEntries()are extracted sonormalizeRequestedSteps()is a thin orchestrator (complexity 7).lib/cmd/vite/scripts.jsL60–L107 — the only change.Feature Info
Description
Restores
npm teston master. Discovered while rebasing #260 onto master post-#259 — flagged as its own standalone fix since master is broken for anyone right now, independent of that PR's review timeline.🤖 Generated with Claude Code