command 'phpstan:init' should not return 0 when file not overriden
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 37
- Fork
- 20
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PrestaShop/php-dev-tools
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
PrestaShop/php-dev-tools#68 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
PrestaShop/php-dev-tools#55 ·
-
Whitespace after file headerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
PrestaShop/php-dev-tools#45 · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
PrestaShop/php-dev-tools#38 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
PrestaShop/php-dev-tools#26 ·
Tutte le issue di PrestaShop/php-dev-tools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
scanaislop/aislop#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
components-web-app/api-components-bundle#403 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
mollie/PrestaShop#1566 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
components-web-app/docs#193 ·
-
docs: add Python and PHP examples to docs/api.mdForse già presa @gaurika-analyst l’ha presa oggi. Apertadocumentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
djazairdev/wilayas#12 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno