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

Update 4 letters for min prefix length #2479

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

davidperezgar
Copy link
Member

@davidperezgar davidperezgar commented Aug 29, 2024

Fixes #2467

Copy link
Member

@dingo-d dingo-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some comments about the docblock changes.

This change should also be covered by tests (warning on prefixes less than 4 characters).

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR @davidperezgar.

Can you please do things properly though ? It looks like you don't understand how docs work.

  • The @since tag should NOT be changed as it indicated when the constant was added. A second @since tag can be added to in explain that the value of the constant changed in WPCS 3.2.0.
  • The @link tag should NOT be changed as it is a reference to explain why the constant was added. A secondary @link tag can be added to the new ticket to explain why it was raised.

Also, this is a functional change, so the tests will need to be updated to match, as can also be seen by the failing build.

@jrfnl
Copy link
Member

jrfnl commented Aug 30, 2024

Ha, looks like @dingo-d and me were reviewing at the same time, but had the same feedback ;-)

@davidperezgar
Copy link
Member Author

Ok! I'll check it , thanks.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing a test with a three character prefix which should be flagged as not acceptable.

@davidperezgar
Copy link
Member Author

I don't understand how it works the unit testing in the sniff.. I'd need some help...

@jrfnl
Copy link
Member

jrfnl commented Sep 3, 2024

I don't understand how it works the unit testing in the sniff.. I'd need some help...

Did you read the CONTRIBUTING guide ?

@davidperezgar
Copy link
Member Author

Did you read the CONTRIBUTING guide ?

Yes!

@GaryJones
Copy link
Member

I see that this sniff is included in WordPress-Extra.

I also see the history of this change is related to plugins, but what about themes and the theme review team? This change will affect those folks who are writing themes with custom functions too - has that impact been considered?

@davidperezgar
Copy link
Member Author

davidperezgar commented Sep 7, 2024

Hello, yes it will impact to themes as well, but we have been considered the benefits of this measure, and that's why is now in the Developers HandBook:
https://developer.wordpress.org/plugins/plugin-basics/best-practices/

We were using this number of prefixes for a some time ago and we are unifying everywhere.

I'm going to ping Themes Team to be aware of it.

@GaryJones
Copy link
Member

There are several mentions of "prefix" in the theme developers handbook, but:

... seem to be the missed opportunities to clarify/define the specific minimum length of such prefixes.

It seems right (to me) to get their buy-in on this before we merge this PR; the Plugins Review Team can continue to require 4 characters as they have apparently have for a while anyway).

@davidperezgar
Copy link
Member Author

I've spoken with Team Rep and they will check with the Team. I don't see a problem for that. Thanks @GaryJones

@kafleg
Copy link
Member

kafleg commented Sep 9, 2024

@GaryJones Thank you for sharing the link. Once we decided to have 4 letter for min prefix length, we'll discuss within the team for updating the handbook.

@davidperezgar
Copy link
Member Author

Thanks! @kafleg !

@rodrigoprimo rodrigoprimo self-requested a review October 14, 2024 13:39
Copy link
Collaborator

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the sniff documentation needs to be updated as well to reflect the changes proposed in this PR:

https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml#L102-L118

@davidperezgar
Copy link
Member Author

I believe now is ready to be reviewed. Thanks.

Copy link
Collaborator

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing the changes, @davidperezgar! Looks good to me now.

@WordPress/wpcs, as far as I can check, all the points raised were addressed and this PR is ready to be merged.

Edit: @jrfnl (as we discussed this via DM), it seems that mentioning teams is not working in this repository. Maybe due to the way permissions are configured in this GH organization. Mentioning the other maintainers as well directly as the team mention above didn't work: @GaryJones and @dingo-d.

@rodrigoprimo
Copy link
Collaborator

@davidperezgar and @kafleg, any updates on including the minimum four-letter prefix rule in the theme handbook? @GaryJones mentioned he'd prefer this information to be added to the theme handbook before merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PrefixAllGlobals: sniff should check for four-letter prefixes
6 participants