Skip to content

Fix autogenerated code detection#1121

Merged
LandonTClipp merged 1 commit intovektra:v3from
rethil:fix_autogenerated_detection
Oct 31, 2025
Merged

Fix autogenerated code detection#1121
LandonTClipp merged 1 commit intovektra:v3from
rethil:fix_autogenerated_detection

Conversation

@rethil
Copy link

@rethil rethil commented Oct 29, 2025

Description

mockery doesn't detect auto-generated files when signature doesn't contain ; character.

In my use-case, those are:

  • // Code generated by go-enum DO NOT EDIT.
  • // Code generated by sqlc. DO NOT EDIT.

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?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

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

This allows to detect files with auto-generated signatures such as:
 - // Code generated by go-enum DO NOT EDIT.
 - // Code generated by sqlc. DO NOT EDIT.
@LandonTClipp
Copy link
Member

Thanks for the fix, I'll merge and publish when the tests pass.

@LandonTClipp LandonTClipp merged commit ed7317f into vektra:v3 Oct 31, 2025
6 checks passed
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.

2 participants