Skip to content

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

Merged
matthewnitschke-wk merged 1 commit into
Workiva:masterfrom
mosuem:ignore-nested-packages
Sep 9, 2026
Merged

matthewnitschke-wk merged 1 commit into
Workiva:masterfrom
mosuem:ignore-nested-packages

Conversation

@mosuem

@mosuem mosuem commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

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
Contributor 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!

@mosuem

mosuem commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping - @robbecker-wf or @nicbiggs-wk ?

@matthewnitschke-wk

Copy link
Copy Markdown
Contributor

@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!

Hey! @mosuem! Sorry, we do not have the best notifications setup for our OSS libraries and I missed this

Yes, we do still rely on and are "working" on dependency_validator. Pub workspaces aren't used very much by our org yet, which is why support for issues like this haven't been prioritized

That being said, we're happy to review and merge any updates! Let us know when this is ready for review and we'll take a look!

@mosuem

mosuem commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Great to hear!

@mosuem
mosuem force-pushed the ignore-nested-packages branch from f836c8e to 1600be7 Compare September 9, 2026 08:40
@mosuem
mosuem marked this pull request as ready for review September 9, 2026 09:23
@mosuem
mosuem requested a review from a team as a code owner September 9, 2026 09:23
@matthewnitschke-wk
matthewnitschke-wk merged commit 3e9c6fd into Workiva:master Sep 9, 2026
12 checks passed
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

2 participants