Description
A package calling another package is not triggering a violation
To Reproduce
- Create
app/modules folder
- Create two packages in the new folder, with
package.yml files 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
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.
Description
A package calling another package is not triggering a violation
To Reproduce
app/modulesfolderpackage.ymlfiles enforcing dependenciesbin/packwerk checkExpected 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
Additional Context
The project structure contains modules in the
app/modulesdirectory. Within each package, each sub-directory is collapsed in Zeitwerk, so for example the directoryapp/modules/package_one/services/service_one.rbis loaded itsPackageOne::ServiceOneinstead ofPackageOne::Services::ServiceOne.I've tried removing the dependency on
.and it triggers violations, but this is because theApplicationControllerandApplicationRecordclasses 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.