command 'phpstan:init' should not return 0 when file not overriden
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
Línea de trabajo
Start by locating the phpstan:init command and inspect how it handles an existing phpstan.neon file in non-interactive mode. Reproduce the case with --dest and an existing file, then verify that the process reports a nonzero exit status when no file is copied, while preserving the successful status for an actual installation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Use case :
- the command is invoked from a script (external symfony command for example), in non-interactive mode (interactive mode is not possible in this context)
phpstan.neonfile already exists
Was the command successful ? I think not, the new file was not copied/installed, we can't consider the init process is a success.
So in this case, command should return 1 or another code maybe 2, but not 0. (2 or more is best option I suppose).
Furthermore, there is another argument for arguing that the command should return 1.
Because of the non possible interaction, symfony has started to fill the errorOutput content, which means that symfony considers that an error happend. ($installPhpStanConfiguration->getErrorOutput() has content, see below).
Example :
$this->io->write("Installation of {$this->getScriptName()} configuration file : ", false);
$installPhpStanConfiguration = new Process(['php', 'vendor/bin/prestashop-coding-standards', 'phpstan:init', '--dest', getcwd()]);
$installPhpStanConfiguration->start();
$installPhpStanConfiguration->wait();
if (!$installPhpStanConfiguration->isSuccessful()) {
$this->io->error('failed !');
throw new RuntimeException("{$this->getPackageName()} configuration : {$installPhpStanConfiguration->getErrorOutput()}");
}
// The process is reported to successful even if the new file was not written :(
// fun fact : isSuccessuf() is true but getErrorOutput() has content
// at this point, we should parse the getErrorOutput() content to guess if an error happened.
- Lenguaje dominante
- PHP
- Estrellas
- 37
- Forks
- 20
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PrestaShop/php-dev-tools
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
PrestaShop/php-dev-tools#68 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
PrestaShop/php-dev-tools#55 ·
-
Whitespace after file headerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 50/100
PrestaShop/php-dev-tools#45 · 2 reacciones ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
PrestaShop/php-dev-tools#38 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
PrestaShop/php-dev-tools#26 ·
Todos los issues de PrestaShop/php-dev-tools
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Do not throw `WordPress.Security.EscapeOutput.OutputNotEscaped` on `apply_shortcodes()`Posiblemente ocupada @tbradsha la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
fe: spell out "Auto increment" in the table editor, "AI" reads as artificial intelligence todayAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
landsman/adminer-desktop#120 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
components-web-app/docs#227 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100