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

internal: run goimports on generated snippets #4037

Closed
codyoss opened this issue May 3, 2021 · 2 comments · Fixed by #4039
Closed

internal: run goimports on generated snippets #4037

codyoss opened this issue May 3, 2021 · 2 comments · Fixed by #4039
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@codyoss
Copy link
Member

codyoss commented May 3, 2021

I believe we should be able to run imports.Process. Currently unformatted imports fail CI on regen. Manually patched in #4025

@codyoss codyoss added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels May 3, 2021
@codyoss
Copy link
Member Author

codyoss commented May 3, 2021

cc @tbpg

@tbpg
Copy link
Contributor

tbpg commented May 3, 2021

goimports is run on generated snippets here:

if len(dirs) > 0 {
cmd := execabs.Command("goimports", "-w", ".")
cmd.Dir = outDir
if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to run goimports: %v", err)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants