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

Add Apache headers to all .go source files #7391

Merged
merged 2 commits into from Jun 22, 2018

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jun 21, 2018

Headers were added by https://github.com/elastic/go-licenser.

Make Changes

Added Targets

  • check-headers - verifies headers exist on .go files.
  • add-headers - adds headers to all .go files.

Changed Targets

  • check - added dependency on check-headers.
  • fmt - added dependency on add-headers.

Variables

  • CHECK_HEADERS_DISABLED - if set then headers are neither checked nor added.

REVIEWERS: I separated this into two commits to make reviewing simpler. You can squash them together.

  • c5cd1f5 - This has the tooling changes.
  • 156763f - This has the updates to the .go files to add headers.

@andrewkroh
Copy link
Member Author

I opened some issues with go-licenser to allow for better integration. Specififically when we add Go x-pack content we will need a way to check those licenses.

@ruflin
Copy link
Member

ruflin commented Jun 21, 2018

@andrewkroh Is there an automated way to add the headers to all files? How did you add them?

@andrewkroh
Copy link
Member Author

The same tool that checks the headers can be used to add them.

go-licenser - This adds headers to all .go files recursively.
go-licenser -d - Checks for the existence of headers.

@andrewkroh
Copy link
Member Author

As discussed with @ruflin and @urso , make fmt will add headers to .go files.

@ruflin
Copy link
Member

ruflin commented Jun 22, 2018

PR looks good to me and we should merge it rather soonish. I think we should have an entry at least in the developer changelog for this.

@ph
Copy link
Contributor

ph commented Jun 22, 2018

Changes LGTM, @andrewkroh won the commit race for 2018. :)

I think we want to apply the same logic to other source code, like our python tests? (in another PR of course)

edited s/wont/won.. thank you phone.

Headers are managed by https://github.com/elastic/go-licenser.

Make Changes

Added

- `check-headers` - verifies headers exist on .go files.
- `add-headers` - adds headers to all .go files.

Changed

- `check` - added dependency on `check-headers`.
- `fmt` - added dependency on `add-headers`.

Variables

- `CHECK_HEADERS_DISABLED` - if set then headers are neither checked nor added.
Add file headers to .go files

Headers were added by running `make fmt`.
@ph ph merged commit 35a7882 into elastic:master Jun 22, 2018
@andrewkroh andrewkroh deleted the feature/apache-file-headers branch June 29, 2018 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants