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

completions: fix mixed tab/spaces indentation #1473

Merged
merged 1 commit into from Dec 7, 2021

Conversation

thaJeztah
Copy link
Contributor

@thaJeztah thaJeztah commented Aug 15, 2021

These templates use 4 spaces for indentation, but some lines used tabs.

These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Contributor Author

thaJeztah commented Aug 15, 2021

@jpmcb @Luap99 ptal

Luap99
Luap99 approved these changes Aug 16, 2021
Copy link
Contributor

@Luap99 Luap99 left a comment

LGTM

@Luap99
Copy link
Contributor

Luap99 commented Aug 16, 2021

@marckhouzam PTAL
I think we should setup some linter for the generated files.

@thaJeztah
Copy link
Contributor Author

thaJeztah commented Aug 16, 2021

I think we should setup some linter for the generated files.

Once support for Go 1.15 is dropped, these templates could potentially stored as separate files (go template?), and included using //go:embed, which would (potentially) make validation/linting easier.

umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 5, 2021
These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link

@stmcginnis stmcginnis left a comment

I wonder if this is going to cause problems with go editors that default to using tabs. Was there an actual problem with these, or is this just cosmetic?

Regardless, I think it's fine to change it - I prefer consistency and makes sense for shell code.

@thaJeztah
Copy link
Contributor Author

thaJeztah commented Nov 11, 2021

I wonder if this is going to cause problems with go editors that default to using tabs.

I don't think editors should format content inside string-literals, but even in that case, this patch shouldn't change that (as there's already content using the same indentation)

Was there an actual problem with these, or is this just cosmetic?

No real problem as far as I'm aware, but it looked sloppy to have a generated file that doesn't stick to its own coding style 😅

umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 15, 2021
These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
umarcor pushed a commit to umarcor/cobra that referenced this issue Nov 16, 2021
These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
jpmcb
jpmcb approved these changes Dec 7, 2021
Copy link
Collaborator

@jpmcb jpmcb left a comment

Looks good - but let's keep a close eye on this in case people report issues with tabs vs. spaces in their generated files. If so, I'll ping and we'll cut a quick v1.3.1

@jpmcb jpmcb merged commit 507caf5 into spf13:master Dec 7, 2021
7 checks passed
umarcor pushed a commit to umarcor/cobra that referenced this issue Dec 7, 2021
These templates use 4 spaces for indentation, but some lines
used tabs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah deleted the completion_nits branch Dec 8, 2021
@thaJeztah
Copy link
Contributor Author

thaJeztah commented Dec 8, 2021

Thanks for reviewing!

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.

None yet

5 participants