From e9443af92454c3484aead71894cd3a9dd8f2b21c Mon Sep 17 00:00:00 2001 From: Jessica Kerr Date: Wed, 14 Mar 2018 09:21:26 -0500 Subject: [PATCH] specify which path we're matching This wasn't clear to me, when I run `depcruise --validate .dependency-cruiser.json src`, exactly what I was trying to match in that regex. (relative to here? relative to src? relative to the file, as passed to `import` ?) Thank you for making this tool and publishing and documenting it! This was really useful yesterday in identifying a circular dependency in TypeScript, which mocha totally barfs on. --- doc/rules-reference.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/rules-reference.md b/doc/rules-reference.md index 932595a7e..5c42fc472 100644 --- a/doc/rules-reference.md +++ b/doc/rules-reference.md @@ -137,6 +137,8 @@ out dependency-cruiser will assume it to be `warn`. A regular expression an end of a dependency should match to be catched by this rule. +In `from`, this is the path from project root to the file containing a dependency. In `to`, this is the path from project root to the file the dependency resolves to. + When path is in a `to` part of a rule it accepts the regular expression 'group matching' special variables `$0`, `$1`, `$2`, ... as well. See 'group matching' below for an explanation & example.