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

Making check Generic names #541

Draft
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

davidperezgar
Copy link
Member

Related #523

@davidperezgar davidperezgar self-assigned this Jul 20, 2024
@davidperezgar davidperezgar linked an issue Jul 20, 2024 that may be closed by this pull request
@ernilambar
Copy link
Member

I dont think we can use WordPress.NamingConventions.PrefixAllGlobals sniff directly here for our purpose. This sniff requires an array of prefixes to check against. If not passed this sniff does not run.

<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
	<properties>
		<property name="prefixes" type="array">
			<element value="ecpt"/>
			<element value="EasyCustomPostTypes"/>
		</property>
	</properties>
</rule>

@davidperezgar
Copy link
Member Author

Yes, you're right, so we should make it manually without PHPCS? then?

@davidperezgar
Copy link
Member Author

So, we have to make it manual. I'd need if to have this function: From the line in the file, detect the function name and the arguments.

I've reviewed and I don't find it. Any guidance?

@davidperezgar
Copy link
Member Author

How could I run the WPCS?

@davidperezgar
Copy link
Member Author

Related WPCS #2481

@davidperezgar
Copy link
Member Author

As @frantorres told me, this check has to be done by PCP, as WPCS won't be able to check all files and prefixes of the plugin. PCP does. Let's make it with a custom sniff.

@davidperezgar davidperezgar changed the title Making check prefix all globals Making check Generic names Oct 21, 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.

Check: Generic function/class/define/option prefix names
3 participants