Shopify/packwerk

[Bug Report] Behaviour of enforce_dependencies: key missing

gmcgibbon opened this issue · 1 comments

Description
Without enforce_dependencies: present in a package config, it is assumed that dependency enforcement is false. I think this is a bug because the key should be required. You can turn off dependency enforcement if you want, but the package YAML should explicitly do so. It makes it easier to turn on later, and to have a more readable config file.

Since dependency enforcement is Packwerk's only flagship check now, I don't know why you wouldn't want to use it eventually.

To Reproduce
Create a package.yml without enforce_dependencies and run bin/packwerk validate. This passes, and Packwerk registers this as being disabled / false.

Expected Behaviour
Validation fails and asks for the ket to exist, or the default is true.

Screenshots
If applicable, add screenshots to help explain your problem.

Version Information

  • Packwerk: 3.0 / edge
  • Ruby 3.2.1

Additional Context
I think we want to make the key required. It makes the most sense to me. All checker keys should likely be made required.

It was a bit of a selling point in the beginning to be able to say "just drop in an empty package.yml to turn a folder into a package". Super low barrier to adoption.

And even long term some packages might never enforce dependencies as they might only serve as dependencies for others.

This is likely the case if you have "stable" code that you don't want to touch at all.