Skip to content
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

Add optional gofmt support #16

Merged
merged 2 commits into from
Nov 15, 2022
Merged

Add optional gofmt support #16

merged 2 commits into from
Nov 15, 2022

Conversation

adamroyjones
Copy link
Contributor

There are two commits: one to remove some type conversions, another that adds optional support for applying gofmt to the generated mocks.

The reason for the latter is that I noticed in a different project that gofumpt -w . passes generated files through gofmt. This includes the mocks generated by ut. As the mocks generated by ut are not gofmt-formatted, the operations go generate ./... and gofumpt -w . do not commute. This flag should ensure (if enabled) that they commute.

This change removes two type conversions.
I noticed in a different project that `gofumpt -w .` passes generated
files through `gofmt`. This includes the mocks generated by ut. As the
mocks generated by ut are not `gofmt`-formatted, the operations
`go generate ./...` and `gofumpt -w .` do not commute.

This commit adds an (optional) flag to the tool to indicate to the tool
that mock files should be passed through `gofmt` before being written
out.
Copy link
Owner

@philpearl philpearl left a comment

Choose a reason for hiding this comment

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

LGTM

@philpearl philpearl merged commit 55c0bd9 into philpearl:master Nov 15, 2022
@adamroyjones adamroyjones deleted the add-gofmt-support branch November 15, 2022 15:06
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