Skip to content

Ignore nested packages in surrounding package (#173) - #183

Draft
mosuem wants to merge 1 commit into
Workiva:masterfrom
mosuem:ignore-nested-packages
Draft

Ignore nested packages in surrounding package (#173)#183
mosuem wants to merge 1 commit into
Workiva:masterfrom
mosuem:ignore-nested-packages

Conversation

@mosuem

@mosuem mosuem commented Aug 24, 2026

Copy link
Copy Markdown

AI-generated -- I will take a look at this myself first, don't read yet :)

Motivation

Fixes #173.

Dependency validator previously scanned all files outside lib/ and bin/ recursively and attributed all Dart/SCSS/Less dependencies to the surrounding package. When a package contains nested packages (e.g. example/host_name/ with its own pubspec.yaml), code in the nested package was incorrectly analyzed as part of the surrounding package, causing false-positive missing dev_dependencies warnings for packages only used within the nested package.

Changes

  • Added listNestedPackages helper to discover all nested package directories (subdirectories containing pubspec.yaml, excluding the root package and hidden directories like .dart_tool/).
  • Excluded nested packages when listing public and non-public files in the surrounding package.
  • Updated unusedDependencies handling so analyzer warning is checked before removing ignored packages.
  • Updated test dependency constraints in executable_test.dart for modern analyzer compatibility.
  • Added comprehensive unit and integration tests in test/utils_test.dart and test/nested_packages_test.dart.
  • Added unreleased changelog entry.

Testing/QA Instructions

Automated tests have been added covering nested package handling and listNestedPackages.
All unit and integration tests pass via dart test.

@mosuem

mosuem commented Aug 24, 2026

Copy link
Copy Markdown
Author

@matthewnitschke-wk it seems this repo is a bit stale - are you still working on it? Or should we rather fork to implement fixes? Just curious!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested packages should be ignored in the surrounding package

1 participant