Skip to content

Commit a7749a8

Browse files
committed
[command] Bundle dependency analysers with dev-tools (#10)
1 parent 4f686d2 commit a7749a8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,9 @@ composer dev-tools gitignore
8383
composer dev-tools:sync
8484
```
8585

86-
The `dependencies` command expects both dependency analyzers to be installed in
87-
the target project:
88-
89-
```bash
90-
composer require --dev shipmonk/composer-dependency-analyser icanhazstring/composer-unused
91-
```
86+
The `dependencies` command ships with both dependency analyzers as direct
87+
dependencies of `fast-forward/dev-tools`, so it works without extra
88+
installation in the consumer project.
9289

9390
The `skills` command keeps `.agents/skills` aligned with the packaged Fast
9491
Forward skill set. It creates missing links, repairs broken links, and

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"fakerphp/faker": "^1.24",
3535
"fast-forward/phpdoc-bootstrap-template": "^1.0",
3636
"friendsofphp/php-cs-fixer": "^3.94",
37+
"icanhazstring/composer-unused": "^0.9.6",
3738
"jolicode/jolinotif": "^3.3",
3839
"phpdocumentor/shim": "^3.9",
3940
"phpro/grumphp": "^2.19",
@@ -42,6 +43,7 @@
4243
"pyrech/composer-changelogs": "^2.2",
4344
"rector/rector": "^2.3",
4445
"saggre/phpdocumentor-markdown": "^1.0",
46+
"shipmonk/composer-dependency-analyser": "^1.8.4",
4547
"symfony/var-dumper": "^7.4",
4648
"symfony/var-exporter": "^7.4",
4749
"symplify/easy-coding-standard": "^13.0",

docs/running/specialized-commands.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ Analyzes missing and unused Composer dependencies.
3333
3434
Important details:
3535

36-
- it requires ``shipmonk/composer-dependency-analyser`` and
37-
``icanhazstring/composer-unused`` to be installed in the target project;
36+
- it ships ``shipmonk/composer-dependency-analyser`` and
37+
``icanhazstring/composer-unused`` as direct dependencies of
38+
``fast-forward/dev-tools``;
3839
- it uses ``composer-dependency-analyser`` only for missing dependency checks
3940
and leaves unused-package reporting to ``composer-unused``;
4041
- it returns a non-zero exit code when missing or unused dependencies are

src/Command/DependenciesCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ private function resolveMissingRequirements(
183183
}
184184

185185
if (! $this->filesystem->exists($dependencyAnalyser)) {
186-
$missing[] = '- vendor/bin/composer-dependency-analyser not found. Install: composer require --dev shipmonk/composer-dependency-analyser';
186+
$missing[] = '- vendor/bin/composer-dependency-analyser not found. Reinstall fast-forward/dev-tools dependencies.';
187187
}
188188

189189
if (! $this->filesystem->exists($composerUnused)) {
190-
$missing[] = '- vendor/bin/composer-unused not found. Install: composer require --dev icanhazstring/composer-unused';
190+
$missing[] = '- vendor/bin/composer-unused not found. Reinstall fast-forward/dev-tools dependencies.';
191191
}
192192

193193
return $missing;

tests/Command/DependenciesCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ public function executeWillFailWhenRequiredFilesAreMissing(): void
105105
$this->output->writeln('<error>Dependency analysis requires the following files:</error>')
106106
->shouldBeCalled();
107107
$this->output->writeln(
108-
'- vendor/bin/composer-dependency-analyser not found. Install: composer require --dev shipmonk/composer-dependency-analyser'
108+
'- vendor/bin/composer-dependency-analyser not found. Reinstall fast-forward/dev-tools dependencies.'
109109
)
110110
->shouldBeCalled();
111111
$this->output->writeln(
112-
'- vendor/bin/composer-unused not found. Install: composer require --dev icanhazstring/composer-unused'
112+
'- vendor/bin/composer-unused not found. Reinstall fast-forward/dev-tools dependencies.'
113113
)
114114
->shouldBeCalled();
115115

0 commit comments

Comments
 (0)