-
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
Feature suggestion: Improve information available about installed standards #2600
Comments
@jrfnl thanks for opening the RFE! I think versioning is important for support cases like, what version of the standard X are you running? |
Sounds like a good change. I'd probably just change the |
I'm not familiar enough with external tooling which integrates PHPCS, but I was a bit wary that could possibly break any of those integrations. |
I'd probably do this in a major release, but I wouldn't add a second command line argument to do that same thing. |
Just thinking - it may be a nice idea to also display the |
I'm currently just extracting the version from composer lock of the package: composer show --format=json phpcompatibility/php-compatibility > vendor/package.json
php -r 'echo json_decode(file_get_contents($argv[1]),1)["versions"][0];' vendor/package.json > vendor/VERSION |
@gsherwood Could this feature request be earmarked for PHPCS 4.x ? |
Closing as replaced by PHPCSStandards/PHP_CodeSniffer#17 |
(I seem to remember seeing a discussion about something like this before, but can't find it anymore, so hoping I'm not opening a duplicate issue)
At this moment, there is the
--version
option to show the version of PHPCS itself, the-i
option to show which (external) standards are installed and the--config-show
option which provides information on the configuration used.I believe it would be helpful if there was a command-line option available which would combine some of this information.
For this to work as I envision, external standards would need to be allowed to pass their version number on to PHPCS through the XML ruleset.
Something along the lines of:
This would require a change to the
phpcs.xsd
file along the lines of adding the below to the<xs:element name="ruleset">
block:Secondly, either one of the above mentioned command-line options would need to be adjusted or a new one should be introduced, let's call it
--list-standards
for now.I imagine the output could then look something like this:
For standards which do not (yet) supply the version number via the
ruleset.xml
file, it could be tried to retrieve the version number via acomposer --show
in case of a Composer based install.For non-Composer based installs, the version could either be left empty of be listed as
Unknown
.Also take note of the ordering of the list: build-in standards first and then external standards in alphabetic order using natsort.
Opinions ?
The text was updated successfully, but these errors were encountered: