Add qa:lint-css task, incorporate style linting into current flow
[MAILPOET-1917]
This commit is contained in:
15
RoboFile.php
15
RoboFile.php
@ -59,8 +59,14 @@ class RoboFile extends \Robo\Tasks {
|
||||
function watchCss() {
|
||||
$css_files = $this->rsearch('assets/css/src/', array('scss'));
|
||||
$this->taskWatch()
|
||||
->monitor($css_files, function() {
|
||||
$this->compileCss();
|
||||
->monitor($css_files, function($changedFile) {
|
||||
$file = $changedFile->getResource()->getResource();
|
||||
$this->taskExecStack()
|
||||
->stopOnFail()
|
||||
->exec('npm run stylelint -- "' . $file . '"')
|
||||
->exec('npm run scss')
|
||||
->exec('npm run autoprefixer')
|
||||
->run();
|
||||
})
|
||||
->run();
|
||||
}
|
||||
@ -313,6 +319,7 @@ class RoboFile extends \Robo\Tasks {
|
||||
return $this->qaCodeSniffer('all');
|
||||
});
|
||||
$collection->addCode(array($this, 'qaLintJavascript'));
|
||||
$collection->addCode(array($this, 'qaLintCss'));
|
||||
return $collection->run();
|
||||
}
|
||||
|
||||
@ -324,6 +331,10 @@ class RoboFile extends \Robo\Tasks {
|
||||
return $this->_exec('npm run lint');
|
||||
}
|
||||
|
||||
function qaLintCss() {
|
||||
return $this->_exec('npm run stylelint -- "assets/css/src/components/**/*.scss"');
|
||||
}
|
||||
|
||||
function qaCodeSniffer($severity='errors') {
|
||||
if ($severity === 'all') {
|
||||
$severityFlag = '-w';
|
||||
|
Reference in New Issue
Block a user