Skip to content

Commit 4f686d2

Browse files
committed
[command] Add dependency analysis command (#10)
1 parent 31e94d1 commit 4f686d2

File tree

7 files changed

+832
-0
lines changed

7 files changed

+832
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ across Fast Forward libraries.
1616

1717
- Aggregates refactoring, PHPDoc, code style, tests, and reporting under a
1818
single Composer-facing command vocabulary
19+
- Adds dependency analysis for missing and unused Composer packages through a
20+
single report entrypoint
1921
- Ships shared workflow stubs, `.editorconfig`, Dependabot configuration, and
2022
other onboarding defaults for consumer repositories
2123
- Synchronizes packaged agent skills into consumer `.agents/skills`
@@ -47,6 +49,10 @@ You can also run individual commands for specific development tasks:
4749
# Run PHPUnit tests
4850
composer dev-tools tests
4951

52+
# Analyze missing and unused Composer dependencies
53+
composer dependencies
54+
vendor/bin/dev-tools dependencies
55+
5056
# Check and fix code style using ECS and Composer Normalize
5157
composer dev-tools code-style
5258

@@ -77,6 +83,13 @@ composer dev-tools gitignore
7783
composer dev-tools:sync
7884
```
7985

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+
```
92+
8093
The `skills` command keeps `.agents/skills` aligned with the packaged Fast
8194
Forward skill set. It creates missing links, repairs broken links, and
8295
preserves existing non-symlink directories. The `dev-tools:sync` command calls
@@ -89,6 +102,7 @@ automation assets.
89102
|---------|---------|
90103
| `composer dev-tools` | Runs the full `standards` pipeline. |
91104
| `composer dev-tools tests` | Runs PHPUnit with local-or-packaged configuration. |
105+
| `composer dependencies` | Reports missing and unused Composer dependencies. |
92106
| `composer dev-tools docs` | Builds the HTML documentation site from PSR-4 code and `docs/`. |
93107
| `composer dev-tools skills` | Creates or repairs packaged skill links in `.agents/skills`. |
94108
| `composer dev-tools:sync` | Updates scripts, workflow stubs, `.editorconfig`, `.gitignore`, wiki setup, and packaged skills. |

docs/api/commands.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ resolution, configuration fallback, PSR-4 lookup, and child-command dispatch.
3030
* - ``FastForward\DevTools\Command\TestsCommand``
3131
- ``tests``
3232
- Runs PHPUnit with optional coverage output.
33+
* - ``FastForward\DevTools\Command\DependenciesCommand``
34+
- ``dependencies``
35+
- Reports missing and unused Composer dependencies.
3336
* - ``FastForward\DevTools\Command\DocsCommand``
3437
- ``docs``
3538
- Builds the HTML documentation site.

docs/running/specialized-commands.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ Important details:
2121
- ``--no-cache`` disables ``tmp/cache/phpunit``;
2222
- the packaged configuration registers the DevTools PHPUnit extension.
2323

24+
``dependencies``
25+
----------------
26+
27+
Analyzes missing and unused Composer dependencies.
28+
29+
.. code-block:: bash
30+
31+
composer dependencies
32+
vendor/bin/dev-tools dependencies
33+
34+
Important details:
35+
36+
- it requires ``shipmonk/composer-dependency-analyser`` and
37+
``icanhazstring/composer-unused`` to be installed in the target project;
38+
- it uses ``composer-dependency-analyser`` only for missing dependency checks
39+
and leaves unused-package reporting to ``composer-unused``;
40+
- it returns a non-zero exit code when missing or unused dependencies are
41+
found.
42+
2443
``code-style``
2544
--------------
2645

0 commit comments

Comments
 (0)