diff --git a/src/Composer/Command/ValidateCommand.php b/src/Composer/Command/ValidateCommand.php index 5730ff490..fb71081d4 100644 --- a/src/Composer/Command/ValidateCommand.php +++ b/src/Composer/Command/ValidateCommand.php @@ -146,7 +146,7 @@ EOT if (\count($errors) > 0) { $io->writeError('' . $name . ' is invalid, the following errors/warnings were found:'); - } elseif (\count($publishErrors) > 0) { + } elseif (\count($publishErrors) > 0 && $checkPublish) { $io->writeError('' . $name . ' is valid for simple usage with Composer but has'); $io->writeError('strict errors that make it unable to be published as a package'); $doPrintSchemaUrl = $printSchemaUrl; diff --git a/tests/Composer/Test/Command/ValidateCommandTest.php b/tests/Composer/Test/Command/ValidateCommandTest.php index bae0b261c..0c30687fd 100644 --- a/tests/Composer/Test/Command/ValidateCommandTest.php +++ b/tests/Composer/Test/Command/ValidateCommandTest.php @@ -142,14 +142,10 @@ OUTPUT $publishDataStripped, [ '--no-check-publish' => true], <<See https://getcomposer.org/doc/04-schema.md for details on the schema # General warnings - No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license. -# Publish warnings -- name : The property name is required -- description : The property description is required OUTPUT ]; }