-
Notifications
You must be signed in to change notification settings - Fork 119
Description
Description
A package calling another package is not triggering a violation
To Reproduce
- Create
app/modulesfolder - Create two packages in the new folder, with
package.ymlfiles enforcing dependencies - Add a class in each package. Make one call the other
- Run
bin/packwerk check
Expected Behaviour
A violation error to be raised
Screenshots
I've created a reproduction of the issue here https://github.com/pareeohnos/packwerk-issue
Version Information
- Packwerk: 3.2
- Ruby 3.3.0
Additional Context
The project structure contains modules in the app/modules directory. Within each package, each sub-directory is collapsed in Zeitwerk, so for example the directory app/modules/package_one/services/service_one.rb is loaded its PackageOne::ServiceOne instead of PackageOne::Services::ServiceOne.
I've tried removing the dependency on . and it triggers violations, but this is because the ApplicationController and ApplicationRecord classes are both located in the root of the project - it still makes not mention of the cross package violation.
If I remove the collapsing altogether, it starts to work correctly but this causes issues in our application so we need the collapsing.