Skip to content

Fix & update phpcs rules#897

Merged
mauteri merged 8 commits intoGatherPress:mainfrom
carstingaxion:fix/update-phpcs-rules
Sep 24, 2024
Merged

Fix & update phpcs rules#897
mauteri merged 8 commits intoGatherPress:mainfrom
carstingaxion:fix/update-phpcs-rules

Conversation

@carstingaxion
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown
Contributor

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
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