respect-validation/bin/console
Henrique Moody 4390e4feb6
Simplify how we load and save files in data/
We had different ways of saving and loading files from `data/`, so I decided to
unify them to simplify things. I repurposed the `DomainInfo` class and named it
`DataLoader`, so we can use the same class to load anything from the `data/`
directory.
2026-01-26 20:28:29 +01:00

54 lines
2.1 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\LintDocsCommand;
use Respect\Dev\Commands\LintMixinCommand;
use Respect\Dev\Commands\LintSpdxCommand;
use Respect\Dev\Commands\SmokeTestsCheckCompleteCommand;
use Respect\Dev\Commands\UpdateDomainSuffixesCommand;
use Respect\Dev\Commands\UpdateDomainToplevelCommand;
use Respect\Dev\Commands\UpdatePostalCodesCommand;
use Respect\Dev\Differ\ConsoleDiffer;
use Respect\Dev\Helpers\DataSaver;
use Respect\Dev\Markdown\CompositeLinter;
use Respect\Dev\Markdown\Linters\AssertionMessageLinter;
use Respect\Dev\Markdown\Linters\ValidatorChangelogLinter;
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 SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use Symfony\Component\Console\Application;
return (static function () {
$differ = new ConsoleDiffer(new Differ(new UnifiedDiffOutputBuilder('', addLineNumbers: true)));
$dataSaver = new DataSaver();
$application = new Application('Respect/Validation', '3.0');
$application->addCommand(new LintDocsCommand($differ, new CompositeLinter(
new AssertionMessageLinter(),
new ValidatorHeaderLinter(),
new ValidatorIndexLinter(),
new ValidatorRelatedLinter(),
new ValidatorTemplatesLinter(),
new ValidatorChangelogLinter(),
)));
$application->addCommand(new LintMixinCommand($differ));
$application->addCommand(new LintSpdxCommand());
$application->addCommand(new UpdateDomainSuffixesCommand($dataSaver));
$application->addCommand(new UpdateDomainToplevelCommand($dataSaver));
$application->addCommand(new UpdatePostalCodesCommand($dataSaver));
$application->addCommand(new SmokeTestsCheckCompleteCommand());
return $application->run();
})();