Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! Adds verbose output
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed Oct 10, 2023
1 parent 83fccb8 commit c817963
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/Commands/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$outputContent = '<error>' . $warning . '</error>';
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
}
}
Expand Down Expand Up @@ -216,6 +218,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$alignExportIgnores = $input->getOption('align-export-ignores');

if ($alignExportIgnores) {
$verboseOutput = '+ Aligning the export-ignores.';
$output->writeln($verboseOutput, OutputInterface::VERBOSITY_VERBOSE);

$this->analyser->alignExportIgnores();
}

Expand All @@ -231,10 +236,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$outputContent = '<error>' . $warning . '</error>';
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
}
} elseif($this->isGlobPatternFileSetable($globPatternFile)) {

try {
if ($this->isDefaultGlobPatternFilePresent()) {
$this->analyser->setGlobPatternFromFile($globPatternFile);
Expand All @@ -252,13 +258,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$outputContent = '<error>' . $warning . '</error>';
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
} catch (InvalidGlobPatternFile $e) {
$warning = "Warning: The provided glob pattern file "
. "'$globPatternFile' is considered invalid.";
$outputContent = '<error>' . $warning . '</error>';
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
}
}
Expand All @@ -274,6 +284,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$expectedGitattributesFileContent = $this->analyser
->getExpectedGitattributesContent();

$verboseOutput = '+ Getting expected .gitattribute file content.';
$output->writeln($verboseOutput, OutputInterface::VERBOSITY_VERBOSE);

if ($expectedGitattributesFileContent !== '') {
if ($createGitattributesFile || $overwriteGitattributesFile) {
try {
Expand All @@ -297,6 +310,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
} catch (GitattributesCreationFailed $e) {
$outputContent .= PHP_EOL . PHP_EOL . $e->getMessage();
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
}
} else {
Expand All @@ -317,6 +333,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
} elseif ($validateArchive) {
try {
$verboseOutput = '+ Validating Git archive.';
$output->writeln($verboseOutput, OutputInterface::VERBOSITY_VERBOSE);

if ($this->isValidArchive($keepLicense)) {
$info = '<info>The archive file of the current HEAD is considered lean.</info>';
$output->writeln($info);
Expand All @@ -339,6 +358,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$errorMessage = 'The archive file of the current HEAD '
. 'is considered invalid due to a missing license file.';
$info = '<error>' . $errorMessage . '</error>' . PHP_EOL;

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

$this->archiveValidator->getArchive()->removeArchive();
}

Expand Down Expand Up @@ -377,6 +399,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$outputContent .= PHP_EOL . PHP_EOL . $e->getMessage();
$output->writeln($outputContent);

$output->writeln($e->getMessage(), OutputInterface::VERBOSITY_DEBUG);

return 1;
}
}
Expand Down

0 comments on commit c817963

Please sign in to comment.