| @@ 40-57 (lines=18) @@ | ||
| 37 | } |
|
| 38 | ||
| 39 | $errors = []; |
|
| 40 | foreach ($files as $file) { |
|
| 41 | if (false === self::exist($file, $parameters['eslint_path'], 'js') || in_array($file, $excludes)) { |
|
| 42 | continue; |
|
| 43 | } |
|
| 44 | ||
| 45 | $process = new Process( |
|
| 46 | sprintf('eslint %s -c %s/.eslint.yml', $file, self::location($parameters)), |
|
| 47 | $parameters['root_directory'] |
|
| 48 | ); |
|
| 49 | $process->run(); |
|
| 50 | if (!$process->isSuccessful()) { |
|
| 51 | $errors[] = new Error( |
|
| 52 | $file, |
|
| 53 | sprintf('<error>%s</error>', trim($process->getErrorOutput())), |
|
| 54 | sprintf('<error>%s</error>', trim($process->getOutput())) |
|
| 55 | ); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| 59 | return $errors; |
|
| 60 | } |
|
| @@ 37-54 (lines=18) @@ | ||
| 34 | } |
|
| 35 | ||
| 36 | $errors = []; |
|
| 37 | foreach ($files as $file) { |
|
| 38 | if (false === self::exist($file, $parameters['scsslint_path'], 'scss') || in_array($file, $excludes)) { |
|
| 39 | continue; |
|
| 40 | } |
|
| 41 | ||
| 42 | $process = new Process( |
|
| 43 | sprintf('scss-lint %s -c %s/.scss_lint.yml', $file, self::location($parameters)), |
|
| 44 | $parameters['root_directory'] |
|
| 45 | ); |
|
| 46 | $process->run(); |
|
| 47 | if (!$process->isSuccessful()) { |
|
| 48 | $errors[] = new Error( |
|
| 49 | $file, |
|
| 50 | sprintf('<error>%s</error>', trim($process->getErrorOutput())), |
|
| 51 | sprintf('<error>%s</error>', trim($process->getOutput())) |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| 56 | return $errors; |
|
| 57 | } |
|