Closed dmolineus closed 4 years ago
e78267cbc6cb8854570431ec302e42834effbc75 provides basic support for custom code styles. It uses the runtime-set
directive. For now configuring each standard path explicitly is required but that should be enough for now.
The PHP_CodeSniffer has a configuration file where it stores some project made configurations, e.g. the installed coding standard paths. Tools like
dealerdirect/phpcodesniffer-composer-installer
detects all installed coding standards and adjust the PHP_CodeSniffer when a composer update is done.I'd like to support the given configuration file. There are two solutions which we might implement:
vendor/squizlabs/php_codesniffer/CodeSniffer.conf
tovendor/phpcq/CodeSniffer.conf
. It would be recognized by the phar. We might need aPostUpdatePluginInterface
then where a tool execute such logic. Our future composer plugin should trigger the post update of phpcq also to keep up to date with composer updates.vendor/squizlabs/php_codesniffer/CodeSniffer.conf
file and set configurations as runtime setting. A prooph of concept would be following bootstrap file:use Phpcq\PluginApi\Version10\BuildConfigInterface; use Phpcq\PluginApi\Version10\ConfigurationOptionsBuilderInterface; use Phpcq\PluginApi\Version10\ConfigurationPluginInterface;
return new class implements ConfigurationPluginInterface { public function getName() : string { return 'phpcs'; }
};