-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Enforce valid function names in packages/block-library/*/src/index.php
files
#52769
Comments
gutenberg_
prefixed function don't exist in packages/block-library
gutenberg_
prefixed functions don't exist in packages/block-library
I'm working on a patch for this issue. |
Excellent initiative! Should we enforce that all function names start with consistent prefix patterns based on what we have today? |
@gziolo Sorry, I'm not sure I understand. Are you referring to the |
Thank you for providing more details in your comment, @gziolo.
Given that the linting rule I'm working on pertains specifically to Gutenberg, I don't foresee any challenges in customizing it to check if a function's name aligns with the naming rule you described, which includes the I think I will need your help with testing the linting rule when it's ready. |
2. Adjust the logic per #52769 (comment).
@gziolo I've implemented a draft version of the linting rule. |
It's fine to ignore all these functions that don't follow patterns. We can't rename them anymore unless we keep all the old names as deprecated aliases calling new function makes that use a proper prefix. I don't think it's worth the effort if a simple code comment would allow us to achieve the same goal. The nice part is that moving forward, the developers will see hints on how to name those functions. This is great work. Thank you so much for coming up with a simple and clean solution so quickly. |
2. Adjust the logic per #52769 (comment).
gutenberg_
prefixed functions don't exist in packages/block-library
packages/block-library/*/src/index.php
files
2. Adjust the logic per #52769 (comment).
What problem does this address?
Follow-up from #52696.
Functions with
gutenberg_
prefixes should not be permitted in theblock-library
package.Please see:
Props: @tellthemachines, @ockham
What is your proposed solution?
After the merge of #52696, a new phpcs sniff should be implemented to check that these functions do not exist in the
block-library
package.The text was updated successfully, but these errors were encountered: