Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPCS checks on unwritable filesystems. #813

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Dec 2, 2024

In #744 a call to setConfigData() was added which has the $temp parameter set to the default, which is true.

This causes PHPCS to attempt to write the given config to disk.
The default config location is.. wp-content/plugins/plugin-check/vendor/squizlabs/php_codesniffer/CodeSniffer.conf

If WordPress is installed on an immutable filesystem (Such as WordPress.org) this causes the entire plugin check to abort.

In #744 a call to setConfigData() was added which has the `$temporary` parameter set to the default, which is `true`.

This causes PHPCS to attempt to write to `wp-content/plugins/plugin-check-trunk/vendor/squizlabs/php_codesniffer/CodeSniffer.conf` which is unwritable on immutable filesystems, causing the entire plugin check to abort.
@dd32 dd32 added the [Type] Bug An existing feature is broken label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dd32 <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: ernilambar <[email protected]>
Co-authored-by: felixarntz <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dd32
Copy link
Member Author

dd32 commented Dec 2, 2024

cc @swissspidy

I've not exactly tested this, I have tested that it allows an unwritable config file not to abort, but I haven't actually tested that it doesn't break the functionality.

This has been deployed to WordPress.org.

@swissspidy
Copy link
Member

@ernilambar Does your custom addon still work with that?

I thought the config needs to be written so that an addon with custom PHPCS checks works as expected.

@ernilambar
Copy link
Member

Yes. Addon is working like before with third parameter set to true.

@swissspidy swissspidy added this to the 1.4.0 milestone Dec 2, 2024
@felixarntz felixarntz merged commit 961eb80 into trunk Dec 2, 2024
28 checks passed
@felixarntz felixarntz deleted the fix/unwritable-filesystem branch December 2, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants