Skip to content
Snippets Groups Projects
Commit e2d5d876 authored by jurgenhaas's avatar jurgenhaas
Browse files

Add phpcs as a composer script

parent c992f5ad
No related branches found
No related tags found
No related merge requests found
......@@ -79,10 +79,27 @@ class Handler {
$scriptDescriptions[$name] = $script['description'];
}
}
foreach ($this->defaults() as $key => $default) {
$scripts[$key] = $default['script'];
$scriptDescriptions[$key] = $default['description'];
}
$settings->setSection('scripts', $scripts);
$settings->setSubSection('extra', 'scripts-description', $scriptDescriptions);
$settings->write();
}
/**
* Provides an array of default scripts for Drupal projects.
*
* @return array
*/
protected function defaults() {
return [
'phpcs' => [
'script' => 'phpcs --standard=DrupalPractice web/modules/custom/ web/profiles/custom/ web/themes/custom/',
'description' => 'Run PHP Code Sniffer on custom code',
],
];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment