Skip to content

Commit

Permalink
XSD: minor touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 23, 2022
1 parent 5d491b6 commit bf0e337
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion PHPCSDebug/Docs/Debug/TokenListStandard.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd" title="Token List">
<?xml version="1.0"?>
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
title="Token List"
>
<standard>
<![CDATA[
Lists how PHPCS tokenizes code.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ In order to use it, you'll need to add the schema related attributes to the `doc

```xml
<documentation
title="Name of the sniff"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
title="Name of the sniff"
>
```

If your IDE or editor supports automatic validation of XML files, you will be notified if your documentation XML file has the correct number of elements, correct type and number of certain attributes, and title length among other things.

#### Validating your docs against the XSD

You can validate your PHPCS XML documentation against the XSD file using [xmllint](https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html). This validation can be run locally if you have xmllint installed, as well as in CI (continuous integration).
You can validate your PHPCS XML documentation against the XSD file using [xmllint](http://xmlsoft.org/xmllint.html). This validation can be run locally if you have xmllint installed, as well as in CI (continuous integration).

An example of a workflow job for GitHub Actions CI looks like this:

Expand All @@ -217,7 +217,7 @@ jobs:
run: xmllint --noout --schema vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd ./YourRuleset/Docs/**/*Standard.xml
```
You'd need to replace the `YourRuleset` with the name of your ruleset of course.
:point_right: You'll need to replace the `YourRuleset` within the command with the name of your ruleset (of course).

Contributing
-------
Expand Down

0 comments on commit bf0e337

Please sign in to comment.