Open fzyzcjy opened 2 years ago
Personally, I like this idea since we also commonly use nested packages and have to ignore them like so:
# pubspec.yaml
dependency_validator:
exclude:
- app/**
My only concern is that this would be inconsistent with how the Dart analyzer works. Right now, if you have a directory structure like the one you outlined, running the analyzer from the root mypackage
will also analyze the example
subpackage. You have to specify an exclude in analysis_options.yaml
to avoid that. In other words, it doesn't really seem like there's precedent for Dart tooling being aware of subpackages and handling them differently than any other subdirectory.
Given that and the fact that this would be a behavioral change that consumers might be relying on, I'm hesitant to introduce this (at least in a minor release). Using the exclude
option is at least an easy way to accomplish the same thing. What do you think?
My only concern is that this would be inconsistent with how the Dart analyzer works. Right now, if you have a directory structure like the one you outlined, running the analyzer from the root mypackage will also analyze the example subpackage. You have to specify an exclude in analysis_options.yaml to avoid that. In other words, it doesn't really seem like there's precedent for Dart tooling being aware of subpackages and handling them differently than any other subdirectory.
The problem is, a dependency in subpackage should not be added to the parent's yaml! So it is indeed a bug.
Hello, would you be able to potentially add an option to easily toggle on/off sub packages without having to explicitly set to exclude each package?
For example:
then when considering mypackage, should not consider files in
example
subpackage