Closed jrfnl closed 5 years ago
Hey @jrfnl, thanks for the suggestion! The reason we're not using that is because we'd also like to set up the default ruleset, and the logic behind either one is pretty much identical.
The reason we're not using that is because we'd also like to set up the default ruleset...
@ChaosExAnima I'm not sure I understand your argument against this as that would still be quite simple to do using something like the below in the dependents.
"scripts": {
"config-cs": [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
"\"vendor/bin/phpcs\" --config-set default_standard 10up-Default"
],
"post-install-cmd": @config-cs,
"post-update-cmd": @config-cs
}
... and the logic behind either one is pretty much identical.
Again, I'm not sure I understand. The logic behind setting the installed_paths
correctly should be so much more complex as it has to look at an array and make sure all the right values are in it (quite apart from finding all the rulesets to add).
For the default_standard
, the logic is simple: add the value if it doesn't exist or overwrite it if it does.
This might solve the issues in #9 and #10
@ChaosExAnima
If we change this package to use dealerdirect/phpcodesniffer-composer-installer
like how @jrfnl is suggesting, then it will automatically fix both #9 and #10
I can also submit a PR if needed.
I have created a PR to use the DealerDirect Composer PHPCS plugin. See #16
The
dealerdirect/phpcodesniffer-composer-installer
package - https://github.com/DealerDirect/phpcodesniffer-composer-installer - can take care of setting the PHPCSinstalled_paths
config for you, rather than doing so using your ownPHPCSConfig.php
.Generally speaking, a ruleset package like this would
suggest
the package and dependents shouldrequire --dev
it. However, I imagine it will work just as well if this package wouldrequire
it.