Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Behaviour of enforce_dependencies: key missing #319

Open
gmcgibbon opened this issue Mar 3, 2023 · 1 comment
Open

[Bug Report] Behaviour of enforce_dependencies: key missing #319

gmcgibbon opened this issue Mar 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@gmcgibbon
Copy link
Member

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.

@gmcgibbon gmcgibbon added the bug Something isn't working label Mar 3, 2023
@exterm
Copy link
Contributor

exterm commented Mar 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants