|
|
|
@ -42,6 +42,7 @@ class ValidateCommand extends BaseCommand
|
|
|
|
|
new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not validate requires for overly strict/loose constraints'),
|
|
|
|
|
new InputOption('no-check-lock', null, InputOption::VALUE_NONE, 'Do not check if lock file is up to date'),
|
|
|
|
|
new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'),
|
|
|
|
|
new InputOption('no-check-version', null, InputOption::VALUE_NONE, 'Do not check if version field is present'),
|
|
|
|
|
new InputOption('with-dependencies', 'A', InputOption::VALUE_NONE, 'Also validate the composer.json of all installed dependencies'),
|
|
|
|
|
new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code for warnings as well as errors'),
|
|
|
|
|
new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file'),
|
|
|
|
@ -86,8 +87,9 @@ EOT
|
|
|
|
|
$checkAll = $input->getOption('no-check-all') ? 0 : ValidatingArrayLoader::CHECK_ALL;
|
|
|
|
|
$checkPublish = !$input->getOption('no-check-publish');
|
|
|
|
|
$checkLock = !$input->getOption('no-check-lock');
|
|
|
|
|
$checkVersion = !$input->getOption('no-check-version');
|
|
|
|
|
$isStrict = $input->getOption('strict');
|
|
|
|
|
list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
|
|
|
|
|
list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll, $checkVersion);
|
|
|
|
|
|
|
|
|
|
$lockErrors = array();
|
|
|
|
|
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
|
|
|
|
@ -107,7 +109,7 @@ EOT
|
|
|
|
|
$path = $composer->getInstallationManager()->getInstallPath($package);
|
|
|
|
|
$file = $path . '/composer.json';
|
|
|
|
|
if (is_dir($path) && file_exists($file)) {
|
|
|
|
|
list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
|
|
|
|
|
list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll, $checkVersion);
|
|
|
|
|
|
|
|
|
|
$this->outputResult($io, $package->getPrettyName(), $errors, $warnings, $checkPublish, $publishErrors);
|
|
|
|
|
|
|
|
|
|