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

Generated files are not goimports-ed #933

Closed
andig opened this issue Aug 22, 2019 · 4 comments
Closed

Generated files are not goimports-ed #933

andig opened this issue Aug 22, 2019 · 4 comments
Milestone

Comments

@andig
Copy link

andig commented Aug 22, 2019

See https://travis-ci.org/andig/ingress/builds/575241832#L232 for an example. It seems as if cobra templates prefer spaces for indent while goimport wants tabs.

Would it make sense to enhance the cobra utility command to goimport or gofmt the generated assets?

@umarcor
Copy link
Contributor

umarcor commented Aug 23, 2019

I think this could be solved by fixing the template (https://github.com/spf13/cobra/blob/master/cobra/tpl/main.go), instead of requiring some specific lint/format tool. It seems that AddCommandTemplate uses tabs only, but spaces are used in MainTemplate and RootTemplate. The specific error you referenced is because of line 13.

BTW, this is fixed in #876.

@andig
Copy link
Author

andig commented Aug 23, 2019

BTW, this is fixed in #876.

I see. #876 seems to contains too many changes at once to actually make it?

@umarcor
Copy link
Contributor

umarcor commented Aug 23, 2019

I see. #876 seems to contains too many changes at once to actually make it?

Sure. I just added it as a reference. Go ahead, reopen #935 and ping @jharshman. This minor change is likely to be merged easily on it's own.

@umarcor
Copy link
Contributor

umarcor commented Dec 24, 2019

Should this be closed now that #980 is merged?

@andig andig closed this as completed Dec 24, 2019
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 a pull request may close this issue.

3 participants