mockery icon indicating copy to clipboard operation
mockery copied to clipboard

Only log issue-845-fix if outpkg and inpackage are set

Open anuraaga opened this issue 1 year ago • 3 comments

PLEASE READ

DO NOT submit tickets without first using the latest version of Go, clearing your local golang package cache, and re-building mockery using the latest Go version and the latest version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.

Description

Mockery outputs a WRN about #845 even when not using inpackage: True. As far as I can tell, without that, the issue is not related so it is confusing to see a warning. While we could add issue-845-fix: true to the config, it makes it confusing since others that read the file won't understand what it means. I think it makes sense to only warn when both outpkg and inpackage are set.

https://github.com/vektra/mockery/blob/13d696b867dc191d645ca4c127527e1265dd3d68/pkg/generator.go#L426

Mockery Version

2.5.0

Go Version

1.23.4

NOTE: Please upgrade to the latest golang version before submitting tickets!

Installation Method

  • [ ] Binary Distribution
  • [ ] Docker
  • [ ] brew
  • [X] go install
  • [ ] Other: [specify]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [etc]

Expected Behavior

[what you expect to happen]

Actual Behavior

[what actually happened]

anuraaga avatar Dec 23 '24 03:12 anuraaga

I think you are right, we shouldn't warn if inpackage isn't set. I will get to this at some point in the next few weeks, unless someone else would like to take a stab at it. Should be very easy.

LandonTClipp avatar Dec 26 '24 05:12 LandonTClipp

Hi @LandonTClipp! Can i take this issue?)

Alhanaqtah avatar Dec 26 '24 15:12 Alhanaqtah

Please do! Thanks @Alhanaqtah.

LandonTClipp avatar Dec 27 '24 04:12 LandonTClipp