-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
CI: add an xml formatting check for docs files #2337
Comments
Hey @jrfnl 👋 I have come up with the following bash script which recursively goes through all the folders in the
Here's a I tested this script locally by mimicking the This script just shows the diff and does not update the xml file. Let me know if that is needed to be implemented! I will create a PR if everything is correct. |
Hi @viditagrawal56, thank you for your interest in helping us figure this out. Would the above script work cross-platform ? I.e. would it be able to run on both *nix systems as well as Windows ? that would be helpful to allow contributors to run the script locally. Another question I'm wondering about: How difficult would it be to create this as a bash script with a parameter for the path(s) to check ? If so, it might be best to create this as a new feature in PHPCSDevTools. What do you think ? |
The script that I wrote works only on Unix-like systems because of the following reasons:-
Although
It's actually pretty straightforward, Here`s the code that for bash script that takes path(s) as parameter.
Here's It's all same at the start with just an addition for checking if args are provided or not and then calling the function for each path at the bottom.
Yeah, I think that would be a great idea! The solution for the cross platform problem of this script is to use wsl, even then What do you think @jrfnl? |
@jrfnl thoughts? |
@viditagrawal56 Sorry, I was out of the office for few days. I do have some more points/questions/suggestions, but am happy to proceed with this. Would you like to open a PR in the PHPCSDevTools repo ? We can talk through the rest of the implementation details there. |
@viditagrawal56 I've opened a ticket in the DevTools repo to continue this discussion: PHPCSStandards/PHPCSDevTools#145 |
See the conversation here: #2334 (comment)
Basically we'd need a little (bash or otherwise) script to gather the files in the
WordPress/Docs
directory and then run the following command against each file withXMLLINT_INDENT
set to (four) spaces.The text was updated successfully, but these errors were encountered: