diff --git a/src/Symfony/Component/Yaml/Command/LintCommand.php b/src/Symfony/Component/Yaml/Command/LintCommand.php
index 368cc2311d..9fdef61af0 100644
--- a/src/Symfony/Component/Yaml/Command/LintCommand.php
+++ b/src/Symfony/Component/Yaml/Command/LintCommand.php
@@ -153,6 +153,7 @@ EOF
{
$countFiles = \count($filesInfo);
$erroredFiles = 0;
+ $suggestTagOption = false;
foreach ($filesInfo as $info) {
if ($info['valid'] && $this->displayCorrectFiles) {
@@ -161,13 +162,17 @@ EOF
++$erroredFiles;
$io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
$io->text(sprintf(' >> %s', $info['message']));
+
+ if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) {
+ $suggestTagOption = true;
+ }
}
}
if (0 === $erroredFiles) {
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
} else {
- $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles));
+ $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
}
return min($erroredFiles, 1);
@@ -182,6 +187,10 @@ EOF
if (!$v['valid']) {
++$errors;
}
+
+ if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) {
+ $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
+ }
});
$io->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));