Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a
--do-not-follow
option. It's like the --exclude option, but instead of excluding the module and all its dependencies, it includes the module - and still leaves out all its dependencies.Motivation and Context
without --exclude or --do-not-follow 😐
This scans everything under node_modules. Interesting, but not for the current project and a waste of cpu cycles for most purposes. It potentially flags relations from within node_modules to lodash as well (although in theory that could be prevented by tightening the rule a bit as well):
--exclude node_modules 👎
This does not scan node_modules, but it now does not see the relation to lodash anymore ...
--do-not-follow node_modules 👍 😄
Do-not-follow combines the best of both worlds. Note that modules dependency-cruiser does not follow any further get a 'folder' shape, so it's clear there might be more information behind it.
It also helps with making visualisations more compact.
You can use any regular expression to specify you want to show up, but not cruised any further. E.g. the complete dependency tree for dependency cruiser's api (
src/main/index.js
) looks like this:... but if you're interested in something more high level, just tell dependency-cruiser so:
(the command for this:
depcruise --do-not-follow "report/|validate/|transpile/" -x "node_modules|^[a-z]+$" -T dot src/main/index.js
)How Has This Been Tested?
🔍 Unit tests.
Types of changes
Checklist: