Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sweetchuck/robo-cdd
Robo task wrapper for the Circular Dependency Detector
https://github.com/sweetchuck/robo-cdd
dependency lint robo-task tree tree-structure validator
Last synced: 2 months ago
JSON representation
Robo task wrapper for the Circular Dependency Detector
- Host: GitHub
- URL: https://github.com/sweetchuck/robo-cdd
- Owner: Sweetchuck
- Created: 2018-12-01T09:28:20.000Z (about 6 years ago)
- Default Branch: 3.x
- Last Pushed: 2024-08-04T19:20:50.000Z (5 months ago)
- Last Synced: 2024-10-05T08:06:27.662Z (3 months ago)
- Topics: dependency, lint, robo-task, tree, tree-structure, validator
- Language: PHP
- Size: 249 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robo - Circular Dependency Detector
[![CircleCI](https://circleci.com/gh/Sweetchuck/robo-cdd/tree/3.x.svg?style=svg)](https://circleci.com/gh/Sweetchuck/robo-cdd/?branch=3.x)
[![codecov](https://codecov.io/gh/Sweetchuck/robo-cdd/branch/3.x/graph/badge.svg?token=Y6GIX9ovAG)](https://app.codecov.io/gh/Sweetchuck/robo-cdd/branch/3.x)@todo
## Install
composer require --dev sweetchuck/robo-cdd
## Usage
**RoboFile.php**
```php
collectionBuilder()
->addCode(function (RoboStateData $data): int {
$data['moduleDependencies'] = $this->collectModuleDependencies();return 0;
})
->addTask(
$this
->taskCircularDependencyDetector()
->setItemLabel('module')
->deferTaskConfiguration('setItems', 'moduleDependencies')
);
}protected function collectModuleDependencies(): array
{
return [
'a' => ['b'],
'b' => ['c'],
'c' => ['a'],
'd' => ['e'],
'e' => ['d'],
];
}
}
```**CLI command**
`vendor/bin/robo validate:module-dependencies`
**Output is something like this:**
```
[Circular Dependency Detector] Detect dependencies among 5 of module items
[Sweetchuck\Robo\cdd\Task\CircularDependencyDetectorTask]
c
a
b
ce
d
e
[Sweetchuck\Robo\cdd\Task\CircularDependencyDetectorTask] Exit code 1
```