mirror of
https://github.com/Respect/Validation.git
synced 2026-03-14 14:25:45 +01:00
Improves SPDX header linting to ensure consistent license metadata across the codebase. Key changes: - Enforce deterministic tag ordering (License-Identifier, FileCopyrightText, FileContributor) to ensure consistency, prevent merge conflicts, and simplify code reviews - Add contributor alias mapping to consolidate contributors with multiple emails or name variations (e.g., "nickl-" → "Nick Lombard") - Add --contributions-strategy option with "blame" (current code authors) and "log" (all historical contributors) to support different attribution philosophies - Add optional path argument to lint specific files or directories - Add --fix option to automatically correct header issues Assisted-by: Claude Code (claude-opus-4-5-20251101)
54 lines
2.1 KiB
PHP
Executable file
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($differ));
|
|
$application->addCommand(new UpdateDomainSuffixesCommand($dataSaver));
|
|
$application->addCommand(new UpdateDomainToplevelCommand($dataSaver));
|
|
$application->addCommand(new UpdatePostalCodesCommand($dataSaver));
|
|
$application->addCommand(new SmokeTestsCheckCompleteCommand());
|
|
|
|
return $application->run();
|
|
})();
|