golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.3k stars 611 forks source link

Skip rewriting output files if unchanged #626

Closed sodul closed 2 years ago

sodul commented 2 years ago

When running mockgen with the output option this checks if the existing file content already exists and skips writing if there is nothing to change.

This will help reduce i/o when changing lots of files, but also reduce the re-indexing triggering in IDEs.

Solves #604

google-cla[bot] commented 2 years ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

sodul commented 2 years ago

Note that this duplicates an other pending PR #618. This one is slightly shorter but either one is fine by me @codyoss.

sodul commented 2 years ago

@codyoss let me know if you need anything else to review here. Thank you!

sodul commented 2 years ago

Gentle ping @codyoss This is a simple change that has a positive impact on IDEs and other tools that rescan on changed files.