Skip to content

feat: goimports configuration options#1138

Merged
LandonTClipp merged 8 commits intovektra:v3from
rfwatson:feat/goimports-local-prefix
Mar 6, 2026
Merged

feat: goimports configuration options#1138
LandonTClipp merged 8 commits intovektra:v3from
rfwatson:feat/goimports-local-prefix

Conversation

@rfwatson
Copy link
Contributor

@rfwatson rfwatson commented Jan 21, 2026

Description

Add goimports local-prefix configuration. Fixes #1098.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Version of Go used when building/testing:

  • 1.22
  • 1.23

How Has This Been Tested?

Mostly manual testing. It seems that testing the actual formatter call could be a bit tricky, happy to take a look at adding some if you think it's worth it though.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@rfwatson rfwatson force-pushed the feat/goimports-local-prefix branch 2 times, most recently from bc0ef83 to dc7ca2f Compare January 21, 2026 06:01
@rfwatson rfwatson marked this pull request as ready for review January 21, 2026 06:53
Copy link
Member

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, let's just extend this a bit more.

@rfwatson rfwatson marked this pull request as draft January 28, 2026 07:51
@rfwatson rfwatson force-pushed the feat/goimports-local-prefix branch 2 times, most recently from 0d6c326 to db3355e Compare February 19, 2026 17:19
@rfwatson rfwatson marked this pull request as ready for review February 19, 2026 17:32
Copy link
Member

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one change, we can delete one of the tests. Once that's done, let's get it merged!

@rfwatson rfwatson force-pushed the feat/goimports-local-prefix branch 3 times, most recently from bdd9486 to 5882b70 Compare March 2, 2026 19:48
@rfwatson rfwatson force-pushed the feat/goimports-local-prefix branch from 5882b70 to 4dfe781 Compare March 2, 2026 19:49
Copy link
Member

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I'm going to give it one last manual verification before merging.

@LandonTClipp
Copy link
Member

Actually, it looks like the tests are revealing backwards-incompatible behavior: https://github.com/vektra/mockery/pull/1138/changes#diff-dd1c701f26e4b66f2c1c1b312fd78581f706770353861da4095b1fbf740c47deL490-L494

These are the values mockery provided by default so we should keep formatonly to true.

@rfwatson
Copy link
Contributor Author

rfwatson commented Mar 4, 2026

Updated.

Which test is failing though? I only see these which don't look related?

@LandonTClipp
Copy link
Member

The test was showing that some mock generation was producing a different result than what was committed (git diff). You fixed the issue but now there is a test that needs its default value updated. Then, we should be good to go.

@rfwatson rfwatson force-pushed the feat/goimports-local-prefix branch from 08408ef to 533f37c Compare March 5, 2026 04:58
@LandonTClipp LandonTClipp changed the title feat: goimports local prefix feat: goimports configuration options Mar 6, 2026
@LandonTClipp LandonTClipp merged commit 1bcb334 into vektra:v3 Mar 6, 2026
6 checks passed
@LandonTClipp
Copy link
Member

Wonderful, thank you @rfwatson for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support formatter options like goimports local prefix

2 participants