Closed clxmstaab closed 3 years ago
The issue is not caused by windows this time but by YAML. The examples for implements etc. are all incorrect those backslashes need to be replaced with \\
.
I see, readme fixing PR incoming.
could/should deptrac validate the yaml? would this help?
@clxmstaab Are you sure that you used single and not double quotes?
Are you sure that you used single and not double quotes?
yep
before the mentioned commit
Does your AuthenticationBusinessContext
directly implements Behat\Behat\Context\Context
or inherits an other class/interface which is located in your vendors?
<?php
use Behat\Behat\Context\Context;
//...
class AuthenticationBusinessContext implements Context
Behat\Behat\Context\Context
needs to be covered by a layer. Can you try following
layers:
#...
- name: Behat
collectors:
- type: className
regex: ^Behat\\.*
ruleset:
FeatureTest:
- Behat
thx for your feedback guys, really appreciate it.
I created a minimal repro for my problem:
https://github.com/clxmstaab/deptrac-issue508
behat does not report the wrong dependency from FeatureTest on Integration..
sorry, its public now.
I created a PR with a solution https://github.com/clxmstaab/deptrac-issue508/pull/1
you are right guys, that adding the double backslashes was not correct. it turns out there were other problems within out config which were unnoticed.
it feels like there is some kind of underlying UX/DX issue, as its pretty easy to configure things wrong but don't be aware of it.
just to let you know, our depfile in the end looks like:
paths:
- app/portal/controllers/
- app/portal/features/
- app/portal/lib/
- app/portal/models/
- app/portal/views/
layers:
- name: Controller
collectors:
- type: className
regex: .*Controller.*
- name: View
collectors:
- type: directory
regex: .*/app/portal/views/.*
- name: ViewModel
collectors:
- type: className
regex: ^(.*\\viewmodel\\.*|I18N|LanguageHelper)$
- name: Service
collectors:
- type: className
regex: .*\\service\\.*
- name: Integration
collectors:
- type: className
regex: .*\\integration\\.*
- name: Persistence
collectors:
- type: className
regex: .*\\persistence\\.*
- name: Business
collectors:
- type: className
regex: .*\\business\\.*
- name: BusinessException
collectors:
- type: className
regex: .*\\exception\\.*
- name: FeatureTest
collectors:
- type: implements
implements: 'Behat\\Behat\\Context\\Context'
- name: ActiveRecord
collectors:
- type: className
regex: ^.+(Record)$
- name: ActionResults
collectors:
- type: className
regex: ^.*(Result)$
# list vendor dependencies
# https://github.com/qossmic/deptrac/issues/506#issuecomment-790677433
- name: Vendor
collectors:
- type: className
regex: ^(ZxcvbnPhp\\.*|WebConnector\\.*|ActionMailer)$
ruleset:
Controller:
- View
- Service
- ViewModel
- BusinessException
- ActionResults
Service:
- Persistence
- Business
- BusinessException
- Integration
- ViewModel
Business:
- BusinessException
- Vendor
Integration:
- Business
- Vendor
Persistence:
- Business
- ActiveRecord
ActiveRecord:
- Business
View:
- ViewModel
ViewModel:
- Business
- BusinessException
FeatureTest:
- Business
- BusinessException
its kind of convoluted.. some of the rules here are necessary because of the class-structures our framework is dictating us.
Would be https://github.com/qossmic/deptrac/issues/327 a possible solution to improve DX/UX?
I guess having a list/visualization of which classes are part of which layer - like described in the linked issue - could be helpful.
my testing on windows suggests that the example mentioned in the readme
does not work.
it works after adjusting it to
is this a windows only issue? is the example in the readme wrong?