respect-validation/bin/console
Henrique Moody 7db3bea8a6
Enhance LintSpdxCommand with contributor tracking and header normalization
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)
2026-02-03 15:23:20 +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($differ));
$application->addCommand(new UpdateDomainSuffixesCommand($dataSaver));
$application->addCommand(new UpdateDomainToplevelCommand($dataSaver));
$application->addCommand(new UpdatePostalCodesCommand($dataSaver));
$application->addCommand(new SmokeTestsCheckCompleteCommand());
return $application->run();
})();