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

Move newline to inside the DisableAutoGenTag block #2030

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dramich
Copy link

@dramich dramich commented Sep 20, 2023

Fixes #2029

@CLAassistant
Copy link

CLAassistant commented Sep 20, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/docs-generation Generation of docs via Cobra label Sep 20, 2023
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.

This seems fine. Is this more stylistic than anything? I'm surprised there are tools that have an opinion on markdown formatting. Or is it more that some version control tools don't want extra newlines at the end of files?

I'd like to understand more on why this is needed.

}
if !cmd.DisableAutoGenTag {
buf.WriteString("\n")
buf.WriteString("###### Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "\n")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we fix not having newlines at the end of the file, we should also remove the newline from the autogenerated tag at the end of the file:

Suggested change
buf.WriteString("###### Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "\n")
buf.WriteString("###### Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs-generation Generation of docs via Cobra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GenMarkdownCustom adds extra newline when DisableAutoGenTag is true
4 participants