-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeptrac.modules.yaml
74 lines (62 loc) · 2.76 KB
/
deptrac.modules.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Place for definitions of modules.
imports:
- deptrac.base.yaml
- deptrac.modules.baseline.yaml
parameters:
layers:
- name: SPL
collectors: [ { type: className, regex: ^Spl.* } ]
- name: PSR
collectors: [ { type: className, regex: ^Psr\\.* } ]
- name: Vendor
collectors:
- type: bool
must: [ { type: className, value: ((.+\\.*)|.*_.*) } ]
must_not: [ { type: directory, value: src/.* }, { type: layer, layer: SPL }, { type: layer, layer: PSR } ]
# === Shared ===
# The shared part is for common concept whitch can has integration on the same
- name: Haystack_Midway
collectors: [ { type: directory, regex: src/Shared/Haystack/.* } ]
# === Modules ===
### Foo
# For each module can be required couple of layers.
- name: Foo_Upstream # An Upstream Layer using by other to integrate with the module.
collectors: [ { type: directory, regex: src/Module/Foo/UserInterface/.* } ]
- name: Foo_Downstream # A Downstream Layer where integrations fot he module with others are kept.
collectors: [ { type: directory, regex: src/Module/Foo/Infrastructure/.* } ]
- name: Foo # Body of module. There shouldn't be dependencies to another unless with Shared modules.
collectors:
- type: bool
must: [ { type: directory, regex: src/Module/Foo/.* } ]
# The Must section above includes the Upstream and Downstream files so we have to exclude like in following example.
# One file can be in just one layer.
must_not: [ { type: layer, layer: Foo_Downstream } ]
### Bar
- name: Bar_Upstream
collectors: [ { type: directory, regex: src/Module/Bar/UserInterface/.* } ]
- name: Bar_Downstream
collectors: [ { type: directory, regex: src/Module/Bar/Infrastructure/.* } ]
- name: Bar
collectors:
- type: bool
must: [ { type: directory, regex: src/Module/Bar/.* } ]
must_not: [ { type: layer, layer: Bar_Upstream }, { type: layer, layer: Bar_Downstream } ]
### Mvc
- name: Mvc_Upstream
collectors: [ { type: className, value: Module\\Mvc\\MvcFacade } ]
- name: Mvc
collectors:
- type: bool
must: [ { type: directory, regex: src/Module/Mvc/.* } ]
must_not: [ { type: layer, layer: Mvc_Upstream } ]
# Place where allowings of dependencies are defined between modules
ruleset:
Haystack_Midway: [ Vendor ]
Foo: [ Haystack_Midway, SPL ] # The Foo module can have dependencies to Haystack_Midway and so on with following.
Foo_Upstream: [ Foo, PSR, Vendor ]
Foo_Downstream: [ Bar_Upstream, Vendor ]
Bar: ~
Bar_Upstream: [ Bar, Vendor ]
Bar_Downstream: [ Mvc_Upstream, Vendor ]
Mvc: [ Vendor ]
Mvc_Upstream: [ Mvc, Vendor ]