dependency_validator icon indicating copy to clipboard operation
dependency_validator copied to clipboard

Support dependency_validator running on analysis_options.yaml files

Open matthewnitschke-wk opened this issue 8 months ago • 0 comments

It is possible, and common practice to add a include: package:<somePackage>/<someEntrypoint>.yaml within an analysis_options.yaml file

For example, this is how pedantic and the newer lints package work

include: package:lints/recommended.yaml

Currently, dependency validator completely ignores this file, but it could, and probably should, audit the dependencies used within these files

I'm proposing the following rules regarding this file:

  • if a dependency is used within the analysis_options.yaml include statement and is not declared within the pubspec.yaml file, the command should fail
  • if a dependency is only used within the analysis_options.yaml include AND is declared as a non-dev dependency, the command should fail

matthewnitschke-wk avatar Jun 20 '24 22:06 matthewnitschke-wk