-
Notifications
You must be signed in to change notification settings - Fork 414
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
Support "exclude" in packages config #708
Comments
@LandonTClipp @kpaulisse is this part of mockery 2.36.0? My "exclude" direction in the config file is ignored, not sure if I'm doing it wrong? i.e this is my config file:
It still generates mocks for the |
@tzachshabtay I believe you need to specify a path that's relative to exclude:
- whatever/reinforced If this is indeed the case, I need to update the docs to make this more clear. |
@LandonTClipp ah thanks, relative path works. As an aside, what I really would have liked here is an exclude regex, this would have allowed me to exclude I would have renamed the current |
You are right, I am kicking myself that I did not name this better. The reason this happened was because exclude was a parameter in the legacy config and someone sent in a pr to port this to the new config. I did not think clearly enough to prevent this unclear naming, that is my fault. That doesn't mean we couldn't also add an exclude-package-regex parameter. To make this better for v3 I'm also totally fine with adding exclude-package that does the same thing as exclude, and then deprecate the usage of exclude. If anyone wants to submit an issue to discuss a proposal for any of these ideas, I am likely to accept it. |
Description
The "exclude" parameter is not recognized when the packages configuration is used. Including this parameter in the configuration has no effect.
Mockery Version
v2.33.2 and latest
master
Golang Version
1.20.8
Installation Method
Steps to Reproduce
We have a package in our code base that doesn't have any interfaces but consistently fails with errors like this:
The
common_test_utils.go
file featured in that error message a test helper that contains code referencing mocks like this:I want to use this configuration in my
.mockery.yaml
file, but there's no code inconfig.go
that recognizes the values in the "Exclude" field:Expected Behavior
It should not descend into the "common" directory and therefore I should not get an error when it fails to process the file in that directory correctly.
Actual Behavior
It descends into the "common" directory and I get the error shown above.
The text was updated successfully, but these errors were encountered: