Allowing public constants without adding dependencies within packages #33
Replies: 1 comment 4 replies
-
Hey @bschrag620 thanks for the issue. I'm not sure I'm understanding mixing the privacy and dependency concerns. We've thought of them as independent responsibilities. There is a mechanism available currently which may help you focus on specific violations over other. You can set "ignored_private_constants" in the pack that is enforcing privacy to exclude certain constants. Dependency doesn't yet have a similar feature available (although at Gusto we added "ignored_dependencies" to an overridden dependency checker), but there's always the possibility of turning off the enforcement until you're ready to handle the violations. Let me know your thoughts! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have just begun the journey of implementing packwerk and I'm really excited for how I think it will help us to reinforce better practices. I've only begun playing around with it in some sample projects and I feel like there some potential for another option in
package.yml
. I believe some of the conversation in issue 2 is related.It feels like there should be a way to allow communication between packages with
I think a possible solution to this is to allow for
publically_enforced_dependencies
to be defined inpackage.yml
. Take the following 2 packages:Taking an example folder structure for
package/bar
as follows:Foo
package would be able to callBar::Fetch
without any violation, but referencingBar::SomethingPrivate
would be flagged as a violation.For me, and again we are just beginning this journey so my experience is essentially nil, is that the current approach seems like organizations trying to migrate their legacy code are faced with either a very large amount of deprecated references to deal with. Through this approach I think there is a path that allows a team to more easily avoid excessive warnings and still be on the path toward a nicely modularized system. I even feel like this is potentially a very nice end state as well - packages can speak freely to one another through their public interface without the need for explicit dependencies on one another.
I've began dabbling a bit with a custom checker and validator for this purpose and am happy to submit the work if it feels like a good option.
Beta Was this translation helpful? Give feedback.
All reactions