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

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

@jpmcb @Luap99 ptal

Copy link
Contributor

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

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

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 pull request 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

Choose a reason for hiding this comment

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

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

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 pull request 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 pull request Nov 16, 2021
These templates use 4 spaces for indentation, but some lines
used tabs.

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

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

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
umarcor pushed a commit to umarcor/cobra that referenced this pull request 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 December 8, 2021 13:01
@thaJeztah
Copy link
Contributor Author

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