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 & update phpcs rules #897

Merged
merged 8 commits into from
Sep 24, 2024

Conversation

carstingaxion
Copy link
Collaborator

@carstingaxion carstingaxion commented Sep 21, 2024

I stumbled upon this error

FILE: includes/core/classes/class-event-query.php
-----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 343 | ERROR | The %i modifier is only supported in WP 6.2 or higher. Found: "%i". (WordPress.DB.PreparedSQLPlaceholders.UnsupportedIdentifierPlaceholder)
 345 | ERROR | The %i modifier is only supported in WP 6.2 or higher. Found: "%i". (WordPress.DB.PreparedSQLPlaceholders.UnsupportedIdentifierPlaceholder)
---

after I removed a // phpcs:ignore ... statement for the mentioned sniff. Curious about the 6.2 version, I started investigating and found that there were two minor syntax errors in one of the config rules.

GatherPress tested itself against the minimum supported WordPress version of 7.4, what is ... let's say early.

Description of the Change

  1. I fixed the wrong syntax, which made my mentioned error disappear correctly.

    then I started adding some unrelated other things

  2. Allowed to use the 'default' textdomain for strings that are 100%-sure part of core.

  3. Added a rule to alert with a warning on @todo comments (Not quiet sure, if this is what we want, or if this makes more trouble)

  4. Added the WordPress-Docs ruleset to make sure everything is properly documented and prepare for an automated code-reference

Closes #

How to test the Change

See the results of the test runner.

Changelog Entry

Changed - Fix & updated phpcs rules

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

Preview changes with Playground

You can preview the recent changes for PR#897 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri mauteri merged commit bbf99c1 into GatherPress:main Sep 24, 2024
13 checks passed
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.

2 participants