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

Configure local WP Code Sniffer #5

Closed
openmindculture opened this issue Nov 16, 2022 · 2 comments · Fixed by #6
Closed

Configure local WP Code Sniffer #5

openmindculture opened this issue Nov 16, 2022 · 2 comments · Fixed by #6
Assignees

Comments

@openmindculture
Copy link
Owner

openmindculture commented Nov 16, 2022

Configure a local WordPress Code Sniffer to validate the code in the IDE before submitting to the WordPress plugin repository, to avoid errors and unnecessary refinement loops to speed up development.

See

@openmindculture
Copy link
Owner Author

openmindculture commented Nov 16, 2022

This setup does not work with PHP 8, see WordPress/WordPress-Coding-Standards#1967

Workaround: install PHP 7.4 alongside PHP 8 on Ubuntu: https://www.linuxbabe.com/ubuntu/php-multiple-versions-ubuntu will provide two different PHP runtimes,

  • /usr/bin/php (default, currently PHP 8)
  • /usr/bin/php7.4

So we can set /usr/bin/php7.4 as interpreter to match the working WordPress + Code Sniffer, and plugin project settings (7.4).

@openmindculture
Copy link
Owner Author

Code sniffing currently still fails WordPress/WordPress-Coding-Standards#1967 (comment)

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 a pull request may close this issue.

1 participant