Skip to content

Search for phpcs.xml file in workspace root folder#29

Open
arisanguinetti wants to merge 1 commit intosoderlind:masterfrom
arisanguinetti:patch-1
Open

Search for phpcs.xml file in workspace root folder#29
arisanguinetti wants to merge 1 commit intosoderlind:masterfrom
arisanguinetti:patch-1

Conversation

@arisanguinetti
Copy link
Copy Markdown

This is my first time with vscode extensions, I think this change this might be useful.

This is my first time with vscode extensions, I think this change this might be useful.
@danieliser
Copy link
Copy Markdown

@soderlind Any chance this could be merged and extrapolated on?

There isn't really a reason why this shouldn't be automated entirely at this point, simply traversing from . relative to the file being formatted, to the workspace root checking for common phpcs file names and defaulting to them.

I'm in a situation currently that I have a default set in the workspace, but each submodule has its own gettext domains which we have rules for detecting when they are incorrect.

So we end up having to make a .vscode/settings.json file in each module to point to that modules rules file.

A standard traversal and search for common files would mean it always uses the closes, most relevant rules to the file being formatted.

@bdkoder
Copy link
Copy Markdown

bdkoder commented Feb 25, 2025

We also facing this issue. This PR would need merge ASAP.

@bdkoder
Copy link
Copy Markdown

bdkoder commented Feb 25, 2025

I wasted a full day for the issue, thanks a lot @arisanguinetti

github-actions bot added a commit that referenced this pull request Mar 9, 2026
…nd VS Code 1.61+ formatter requirement

- Add missing phpcbf.configSearch setting (searches up directory tree for phpcs.xml)
- Document ${workspaceFolder} variable support in phpcbf.standard (added in v0.0.9)
- Update deprecated ${workspaceRoot} example in executablePath to ${workspaceFolder}
- Clarify phpcbf.onsave interaction with editor.formatOnSave
- Add VS Code 1.61+ note about editor.defaultFormatter requirement
- Add phpcbf.configSearch to default settings example

Closes #29 (the configSearch feature was already implemented; this documents it)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants