[Repo Assist] refactor: remove unintended this.standard mutation in getArgs()#120
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
Conversation
getArgs() called getStandard(document) and stored the result back to this.standard as a side effect. This was unintentional: loadSettings() is the only method that should update this.standard. The mutation made getArgs() harder to reason about (a method whose name implies it only builds an argument list also silently modifies state). In practice the behaviour was harmless because loadSettings() is called before every format() invocation, but the pattern could lead to confusion or subtle bugs if the call order changes. Use a local const instead so getArgs() remains a pure builder with no observable side effects on the instance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
66 tasks
github-actions bot
added a commit
that referenced
this pull request
Apr 2, 2026
Summarises all bug fixes that are ready to ship, drawn from the open Repo Assist PRs (primarily #106, #114, #117, #120, #124 and the earlier consolidated fixes). The version number in package.json is intentionally not changed here (that file requires maintainer action due to protected-file restrictions). This PR exists so the maintainer can review the intended release notes and bump the version when ready. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 This is an automated pull request from Repo Assist.
Problem
getArgs()contained an unintentional side effect: it calledthis.getStandard(document)and stored the result back intothis.standardas a by-product of building the argument list.This is problematic because:
getArgs()reads like a pure builder (returns an array of CLI arguments) but silently mutates instance state.this.standardis loaded byloadSettings()and read bygetStandard(); havinggetArgs()overwrite it mid-flight makes the data flow harder to follow.In practice the bug was harmless —
loadSettings()is called before everyformat()invocation — but the pattern is misleading.Fix
Use a local
constsogetArgs()computes the standard for the argument list without touchingthis.standard:this.standardis now exclusively managed byloadSettings().Test Status
✅
node --check extension.js— no syntax errors✅
npm run test:unit— 7/7 tests pass