Skip to content

Any way of warning when extraneous dependencies exist in a package.yml file? #192

@oskarpearson

Description

@oskarpearson

Description

Running packwerk check should ideally show a warning/error when a package.yml file includes items in the dependencies: block that are not actually dependencies in the code.

To Reproduce

Start with a codebase with multiple packages in it, and where packwerk check and packwerk validate are both passing as expected.

Modify one of the package's package.yml files (package_a) to add a dependency on a different package (package b). Ensure that you don't create any cyclic loops in this experiment. Don't make any ruby code changes - the intention is to just add an extraneous dependency to package_b

Run packwerk validate and packwerk check, and note that the output indicates that the configuration is valid.

Expected Behaviour

I'd expect a warning or error saying that there's an extraneous/unused dependency on package_b in package_a.

Screenshots

N/A

Version Information

  • Packwerk: v2.1.1
  • Ruby 2.7.4p191

Additional Context

As our developers change code, they sometimes inadvertently remove the code that previously triggered a dependency. Ideally, packwerk would let them know this, so that they can remove the obsolete line from the package.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions