Skip to content

Commit 52b8231

Browse files
committed
Fix coverage metadata and stabilize dev-tools command tests
1 parent 565cd2a commit 52b8231

44 files changed

Lines changed: 206 additions & 89 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Composer/Capability/DevToolsCommandProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@
3131
*/
3232
final class DevToolsCommandProvider implements CommandProvider
3333
{
34+
private const string COMMAND_NAMESPACE = 'FastForward\\DevTools\\Console\\Command\\';
35+
3436
/**
3537
* {@inheritDoc}
3638
*/
3739
public function getCommands()
3840
{
3941
return array_map(
4042
static fn(Command $command): BaseCommand => new ProxyCommand($command),
41-
DevTools::create()->all(),
43+
array_filter(
44+
DevTools::create()->all(),
45+
static fn(Command $command): bool => str_starts_with($command::class, self::COMMAND_NAMESPACE),
46+
),
4247
);
4348
}
4449
}

src/Console/Command/AgentsCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@
3333
/**
3434
* Synchronizes packaged Fast Forward project agents into the consumer repository.
3535
*/
36-
#[AsCommand(name: 'agents', description: 'Synchronizes Fast Forward project agents into .agents/agents directory.')]
36+
#[AsCommand(
37+
name: 'agents:agents',
38+
description: 'Synchronizes Fast Forward project agents into .agents/agents directory.',
39+
aliases: ['agents'],
40+
)]
3741
final class AgentsCommand extends Command
38-
{ use HasJsonOption;
42+
{
43+
use HasJsonOption;
3944
use LogsCommandResults;
4045

4146
private const string AGENTS_DIRECTORY = '.agents/agents';

src/Console/Command/ChangelogCheckCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
description: 'Checks whether a changelog file contains meaningful unreleased entries.'
3939
)]
4040
final class ChangelogCheckCommand extends Command
41-
{ use HasJsonOption;
41+
{
42+
use HasJsonOption;
4243
use LogsCommandResults;
4344

4445
/**

src/Console/Command/ChangelogEntryCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
description: 'Adds a changelog entry to Unreleased or a specific version section.'
4242
)]
4343
final class ChangelogEntryCommand extends Command
44-
{ use HasJsonOption;
44+
{
45+
use HasJsonOption;
4546
use LogsCommandResults;
4647

4748
/**

src/Console/Command/ChangelogNextVersionCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
description: 'Infers the next semantic version from the Unreleased changelog section.'
4040
)]
4141
final class ChangelogNextVersionCommand extends Command
42-
{ use HasJsonOption;
42+
{
43+
use HasJsonOption;
4344
use LogsCommandResults;
4445

4546
/**

src/Console/Command/ChangelogPromoteCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
description: 'Promotes Unreleased entries into a published changelog version.'
4242
)]
4343
final class ChangelogPromoteCommand extends Command
44-
{ use HasJsonOption;
44+
{
45+
use HasJsonOption;
4546
use LogsCommandResults;
4647

4748
/**

src/Console/Command/ChangelogShowCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
*/
3838
#[AsCommand(name: 'changelog:show', description: 'Prints the notes body for a released changelog version.')]
3939
final class ChangelogShowCommand extends Command
40-
{ use HasJsonOption;
40+
{
41+
use HasJsonOption;
4142
use LogsCommandResults;
4243

4344
/**

src/Console/Command/CodeOwnersCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@
3737
/**
3838
* Generates and synchronizes CODEOWNERS files from local project metadata.
3939
*/
40-
#[AsCommand(name: 'codeowners', description: 'Generates .github/CODEOWNERS from local project metadata.')]
40+
#[AsCommand(
41+
name: 'github:codeowners',
42+
description: 'Generates .github/CODEOWNERS from local project metadata.',
43+
aliases: ['.github/CODEOWNERS', 'codeowners'],
44+
)]
4145
final class CodeOwnersCommand extends Command
42-
{ use HasJsonOption;
46+
{
47+
use HasJsonOption;
4348
use LogsCommandResults;
4449

4550
/**
@@ -112,7 +117,7 @@ protected function configure(): void
112117
protected function execute(InputInterface $input, OutputInterface $output): int
113118
{
114119
$targetPath = $this->filesystem->getAbsolutePath((string) $input->getOption('file'));
115-
$targetDirectory = $this->filesystem->dirname($targetPath);
120+
$targetDirectory = $this->filesystem->getDirectory($targetPath);
116121
$overwrite = (bool) $input->getOption('overwrite');
117122
$dryRun = (bool) $input->getOption('dry-run');
118123
$check = (bool) $input->getOption('check');

src/Console/Command/CodeStyleCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
* This class MUST NOT be overridden and SHALL rely on external tools like ECS and Composer Normalize.
3838
*/
3939
#[AsCommand(
40-
name: 'code-style',
41-
description: 'Checks and fixes code style issues using EasyCodingStandard and Composer Normalize.'
40+
name: 'standards:code-style',
41+
description: 'Checks and fixes code style issues using EasyCodingStandard and Composer Normalize.',
42+
aliases: ['code-style']
4243
)]
4344
final class CodeStyleCommand extends Command
44-
{ use HasJsonOption;
45+
{
46+
use HasJsonOption;
4547
use LogsCommandResults;
4648

4749
/**

src/Console/Command/CopyResourceCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@
3939
/**
4040
* Copies packaged or local resources into the consumer repository.
4141
*/
42-
#[AsCommand(name: 'copy-resource', description: 'Copies a file or directory resource into the current project.')]
42+
#[AsCommand(
43+
name: 'dev-tools:sync:copy',
44+
description: 'Copies a file or directory resource into the current project.',
45+
aliases: ['copy-resource']
46+
)]
4347
final class CopyResourceCommand extends Command
44-
{ use HasJsonOption;
48+
{
49+
use HasJsonOption;
4550
use LogsCommandResults;
4651

4752
/**

0 commit comments

Comments
 (0)