-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add XML Schema Definition #1433
Conversation
I haven't looked the code over in detail, but very much like the principle of this! Well done! |
Thanks, I noticed PHPUnit has an XSD which I find very helpful so I started searching for one for PHP_CodeSniffer. I ended up writing one using the annotated sample file as an example. NOTE: It would be best if a better URL for the scheme definition file was provided (e.g. http://schema.squizlabs.com/3.0/phpcs.xsd). For now it works using https://raw.githubusercontent.com/renaatdemuynck/PHP_CodeSniffer/patch-1/phpcs.xsd but that's not a very user-friendly URL... |
Thanks a lot for doing this. I only found a couple of minor things that needed changing, but I also reformatted the XSD to remove some custom types (just fits my brain better for maintenance) and allowed tags in any order (was failing on some WordPress rulesets). |
@renaatdemuynck Would the intention be to suggest that <ruleset name="My Project"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> (but with a nicer versioned URL)? |
@GaryJones That is exactly how i did it. I tested it in Eclipse with the following URL: https://raw.githubusercontent.com/renaatdemuynck/PHP_CodeSniffer/patch-1/phpcs.xsd and it worked. But there should indeed be a nicer url like |
@gsherwood Is it possible to get the XSD under a friendlier versioned URL please? |
A relative path also works ... <ruleset
name="example"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd"> |
@gsherwood Any plans yet on getting the XSD under a friendlier URL as suggested by @GaryJones ? |
See: * squizlabs/PHP_CodeSniffer#1433 * https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.2.0 Note: I have not done this for the `Consistence` ruleset as that is a copy of another ruleset and should be fixed there.
See: * squizlabs/PHP_CodeSniffer#1433 * https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.2.0 Note: I have not done this for the `Consistence` ruleset as that is a copy of another ruleset and should be fixed there.
See: * squizlabs/PHP_CodeSniffer#1433 * https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.2.0 Note: I have not done this for the `Consistence` ruleset as that is a copy of another ruleset and should be fixed there.
No description provided.