WordPress / WordPress/WordPress-Coding-Standards

CI: add an xml formatting check for docs files

Open
#2,337 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Help wanted Type: Chores/Cleanup
Dominant language
PHP
Stars
2.8k
Forks
521
Avg merge
5d 20h
Merged PRs (30d)
1

Description

See the conversation here: https://github.com/WordPress/WordPress-Coding-Standards/pull/2334#discussion_r1294579815

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 with XMLLINT_INDENT set to (four) spaces.

diff -B --tabsize=4 ./WordPress/Docs/Cat/SniffNameStandard.xml <(xmllint --format "./WordPress/Docs/Cat/SniffNameStandard.xml")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked pull request discussion and inspect the WordPress/Docs directory to determine how its XML files should be gathered. Run the shown xmllint and diff check with XMLLINT_INDENT set to four spaces; the work is done when CI detects incorrectly formatted docs files.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
ci-cd, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.