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

Add XML Schema Definition #1433

Merged
merged 2 commits into from
Nov 1, 2017
Merged

Conversation

renaatdemuynck
Copy link
Contributor

No description provided.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 27, 2017

I haven't looked the code over in detail, but very much like the principle of this! Well done!

@renaatdemuynck
Copy link
Contributor Author

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...

@gsherwood gsherwood added this to the 3.1.0 milestone Jun 13, 2017
@gsherwood gsherwood modified the milestones: 3.2.0, 3.1.0 Aug 6, 2017
@gsherwood gsherwood merged commit d1cde71 into squizlabs:master Nov 1, 2017
gsherwood added a commit that referenced this pull request Nov 1, 2017
@gsherwood
Copy link
Member

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).

@GaryJones
Copy link
Contributor

@renaatdemuynck Would the intention be to suggest that .phpcs.xml.dist files can now start with something like:

<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)?

@renaatdemuynck
Copy link
Contributor Author

@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 https://schema.<domain>/<version>/<name>.xsd or https://<domain>/schemas/<name>_<version>.xsd or something else (I based my example on the XSD URL of PHPUnit: http://schema.phpunit.de/4.5/phpunit.xsd).

@renaatdemuynck renaatdemuynck deleted the patch-1 branch November 30, 2017 13:11
@GaryJones
Copy link
Contributor

@gsherwood Is it possible to get the XSD under a friendlier versioned URL please?

@glen-84
Copy link
Contributor

glen-84 commented May 19, 2018

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">

@jrfnl
Copy link
Contributor

jrfnl commented Sep 4, 2018

@gsherwood Any plans yet on getting the XSD under a friendlier URL as suggested by @GaryJones ?

jrfnl added a commit to jrfnl/slevomat-coding-standard that referenced this pull request May 22, 2019
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.
kukulich pushed a commit to slevomat/coding-standard that referenced this pull request May 22, 2019
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.
kukulich pushed a commit to slevomat/coding-standard that referenced this pull request Nov 28, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants