-
Notifications
You must be signed in to change notification settings - Fork 10
Description
🤖 This PR was created by Repo Assist, an automated AI assistant.
This is a release candidate for v0.0.10 that consolidates all critical bug fixes from the many open Repo Assist PRs into a single, reviewable change. Merging this one PR gives you a releasable 0.0.10.
For the maintainer: Rather than reviewing 35 individual PRs, you can review this single PR. It incorporates the most important fixes. The other Repo Assist PRs can be closed after this merges.
Changes
Bug Fixes
- Fix hang when nothing to fix (exit code 0 →
reject()cleanly with no edits). Closes Indent when saving does not work if phpcbf has nothing to indent #39. - Always close stdin regardless of debug mode, preventing
onWillSaveTextDocumenttimeout errors on some phpcbf builds. Closes onWillSaveTextDocument-listener error #35. - Fix
fs.existsasync race condition inaddRootPath()— replaced with synchronousfs.existsSyncsoexecutablePathis fully resolved beforeformat()is called. This fixes the "works after changing settings but not after restart" bug. Closes executablePath broken #36. - Fix broken exit code 3 error display — the old
phpcbfErrorpattern registered thestdout.on('data')listener too late (after spawn), so errors were never shown. Now stdout is collected and shown correctly. resolve([])instead ofreject()inprovideDocumentFormattingEditswhen no changes are needed — eliminates spurious "Formatter failed" VS Code notifications. Closes Warning in debugger tools when saving file #19.- Read
phpcbf.onsaveper-document URI inonWillSaveTextDocumentso multi-root workspaces with per-folder settings work correctly. Closes add ignorePatterns configuration #27. - Resolve
~,./relative paths,\$\{workspaceFolder},\$\{workspaceRoot}inphpcbf.standard— so team configs like"./ruleset.xml"or"~/standards/ruleset.xml"work without hardcoded paths. Closes ${workspaceRoot} inside phpcbf.debug #7, phpcbf.standard doesn't allow relative paths or ${workspaceFolder} #38. - Clean up temp file when a spawn error occurs (previously leaked on error path).
Compatibility
- Set
cwd: TmpDirincp.spawnso phpcs/phpcbf can write temporary diff files on macOS/Linux where the default working directory may be read-only. Closes Detect phpcs version and add option --no-patch if version 2.* #16. - Use
path.join()for temp file path instead of string concatenation, fixing path separator issues on Windows.
Polish
- Only reload settings on
phpcbf.*config changes — prevents unnecessaryloadSettings()calls on every VS Code settings change (e.g. editor font size). - Version bump to 0.0.10 in
package.jsonandCHANGELOG.md.
Closes
Closes #7, #16, #19, #27, #35, #36, #38, #39
Test Status
✅ Unit tests pass: node --test test/unit.test.js — 7/7 tests pass
✅ Syntax check: node --check extension.js — no syntax errors
Relationship to Other Open PRs
This PR supersedes the following Repo Assist PRs, which can be closed after merging:
- [Repo Assist] fix: consolidate critical bug fixes in format() and related helpers #69 (consolidated critical fixes — subset of this PR)
- [Repo Assist] fix: always close stdin in format() regardless of debug mode (closes #35) #90 (stdin fix)
- [Repo Assist] fix: resolve([]) instead of reject() in provideDocumentFormattingEdits (closes #19) #88 (resolve([]) fix)
- [Repo Assist] fix: read phpcbf.onsave per-document URI in onWillSaveTextDocument #68 (per-document onsave)
- [Repo Assist] fix: set cwd to TmpDir in cp.spawn for phpcs 2.x compatibility #73 (cwd: TmpDir)
- [Repo Assist] fix: resolve relative paths and ~ in phpcbf.standard against workspace root #65 (relative paths in standard)
- [Repo Assist] fix: only reload settings when phpcbf configuration changes #86 (config reload filter)
Human PR #97 (PHP_CodeSniffer link update by @rodrigoprimo) should be merged separately — it is not included here.
Generated by Repo Assist · ◷
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f
Warning
🛡️ Protected Files
This was originally intended as a pull request, but the patch modifies protected files: package.json.
These files may affect project dependencies, CI/CD pipelines, or agent behaviour. Please review the changes carefully before creating the pull request.
Click here to create the pull request once you have reviewed the changes
To route changes like this to a review issue instead of blocking, configure protected-files: fallback-to-issue in your workflow configuration.