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

"Hidden" standard with helper tools for WPCS maintainers #1803

Open
jrfnl opened this issue Sep 23, 2019 · 1 comment
Open

"Hidden" standard with helper tools for WPCS maintainers #1803

jrfnl opened this issue Sep 23, 2019 · 1 comment

Comments

@jrfnl
Copy link
Member

jrfnl commented Sep 23, 2019

There are a number of lists in WPCS which should be updated on a regular basis - on every WP release - and gathering the information needed for this manually is a big maintenance burden.

Think:

It would be relatively easy to create a few sniffs which could be run over WP Core to gather this information.
Those sniffs however would have no value for the end-users of WPCS, only for WPCS developers.

So, what I'm proposing is as follows:

  • Add a new folder AnalyseWPCore with a ruleset.xml and sniff directory.
  • Add this folder to .gitattributes to be export-ignored. This way it will not be available in released versions of WPCS, but will only be available in git clones.
  • Over time add some custom sniffs to that directory which can gather the information we need to easily update the above mentioned lists.

Potentially future enhancements:

  • Add some custom reports which would pre-format the output of certain sniffs in a way that the output could just be copy/pasted into the right lists.
  • Add a bash script to run the reports in one go and potentially even update the lists in WPCS automatically.
  • Potentially run the reports via GH Actions on a cron schedule an automatically open an issue/PR/post to Slack when an update is needed.
    Note: we need to be careful about running against WP trunk though as we don't want WPCS to start flagging things which haven't been released et.

Opinions ?

FYI: I've already got a variation of the PrefixAllGlobals sniff ready for instance to allows us to update the global variables list easily.

@jrfnl
Copy link
Member Author

jrfnl commented Jul 2, 2023

FYI: I've made a very very preliminary start with this as the sniffs have to be checked against WP Core for the WPCS 3.0.0 release again and manually checking everything is time consuming, error prone and tedious.

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

No branches or pull requests

1 participant