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