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

Format all *.go files to have the empty line above the package declaration #74

Closed
ckadner opened this issue Nov 30, 2023 · 1 comment · Fixed by #77
Closed

Format all *.go files to have the empty line above the package declaration #74

ckadner opened this issue Nov 30, 2023 · 1 comment · Fixed by #77
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@ckadner
Copy link
Member

ckadner commented Nov 30, 2023

We should be consistently format all *.go files to have an empty line above the package declaration.

Without the empty line, go fmt will treat the license header as the package doc and reformat it according to Go doc format standards, and IDE will show the license text as package documentation 🙃

Originally posted by @ckadner in #68 (comment)

@ckadner ckadner added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Nov 30, 2023
@spolti
Copy link
Contributor

spolti commented Nov 30, 2023

The goal is to add a new step to take care of the license headers as part of the go fmt make goal to keep it consistent across all files it is present.

This new step will have:

  • a standalone make goal: make add-header
  • will be called as part of the make fmt

Pre requisites:

  • the headers should not have tabs, only spaces.

Tool to use:

  • go install github.com/google/addlicense@latest

Makefile call:

.PHONY: addheaders
addheaders:
	./scripts/addheaders.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants