respect-validation/bin/console
Henrique Moody 0190f3e109
Group lint-related commands together
Since we have so many lint-related commands now, it makes sense to group
them together to it's easier to spot them.
2026-01-26 20:14:09 +01:00

52 lines
2 KiB
PHP
Executable file

#!/usr/bin/env php
<?php
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: (c) Respect Project Contributors
*/
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use Respect\Dev\Commands\CreateMixinCommand;
use Respect\Dev\Commands\LintDocsCommand;
use Respect\Dev\Commands\SmokeTestsCheckCompleteCommand;
use Respect\Dev\Commands\LintSpdxCommand;
use Respect\Dev\Commands\UpdateDomainSuffixesCommand;
use Respect\Dev\Commands\UpdateDomainToplevelCommand;
use Respect\Dev\Commands\UpdatePostalCodesCommand;
use Respect\Dev\Markdown\CompositeLinter;
use Respect\Dev\Markdown\Differ as MarkdownDiffer;
use Respect\Dev\Markdown\Linters\AssertionMessageLinter;
use Respect\Dev\Markdown\Linters\ValidatorHeaderLinter;
use Respect\Dev\Markdown\Linters\ValidatorIndexLinter;
use Respect\Dev\Markdown\Linters\ValidatorRelatedLinter;
use Respect\Dev\Markdown\Linters\ValidatorTemplatesLinter;
use Respect\Dev\Markdown\Linters\ValidatorChangelogLinter;
use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use Symfony\Component\Console\Application;
return (static function () {
$differ = new MarkdownDiffer(new Differ(new UnifiedDiffOutputBuilder('', addLineNumbers: true)));
$application = new Application('Respect/Validation', '3.0');
$application->addCommand(new CreateMixinCommand());
$application->addCommand(new LintDocsCommand($differ, new CompositeLinter(
new AssertionMessageLinter(),
new ValidatorHeaderLinter(),
new ValidatorIndexLinter(),
new ValidatorRelatedLinter(),
new ValidatorTemplatesLinter(),
new ValidatorChangelogLinter(),
)));
$application->addCommand(new LintSpdxCommand());
$application->addCommand(new UpdateDomainSuffixesCommand());
$application->addCommand(new UpdateDomainToplevelCommand());
$application->addCommand(new UpdatePostalCodesCommand());
$application->addCommand(new SmokeTestsCheckCompleteCommand());
return $application->run();
})();