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

Header Improvements (File description and scope) #706

Closed
krisnova opened this issue Oct 20, 2016 · 3 comments
Closed

Header Improvements (File description and scope) #706

krisnova opened this issue Oct 20, 2016 · 3 comments

Comments

@krisnova
Copy link
Contributor

Would like to propose a format to start including descriptive headers in kops code.

Digging into kops is fun, but I am constantly referencing my notes as I explore the code base.

I think it would be helpful to store descriptions and code docs in the files themselves. Not a hard requirement, but it would be nice to have an agreed upon format and blessing to start doing this if an engineer so desires

/*
Copyright 2016 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

NOTES GO HERE
Holds logic that will <something>. 
This code connects <other pieces> and solves <problem>
etc, etc, etc
NOTES GO HERE

*/

Thoughts?

@chrislovecnm
Copy link
Contributor

We actually have a standard on the use of a proper license header that needs to be documented ... We need the boilerplate block to make the K8s lawyers happy, to be able to run the header checker that I have.

Another code block afterward I think is awesome.

See:

https://github.com/kubernetes/kops/tree/master/hack/boilerplate

@krisnova
Copy link
Contributor Author

krisnova commented Oct 20, 2016

Makes sense..

/*
Copyright 2016 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
NOTES GO HERE
Holds logic that will <something>. 
This code connects <other pieces> and solves <problem>
etc, etc, etc
NOTES GO HERE
*/

This works for me

@chrislovecnm
Copy link
Contributor

chrislovecnm commented Oct 20, 2016

FYI -

$ hack/verify-boilerplate.sh
Boilerplate header is wrong for: /Users/clove/Workspace/src/k8s.io/kops/cloudmock/aws/mockec2/api.go
Boilerplate header is wrong for: /Users/clove/Workspace/src/k8s.io/kops/cloudmock/aws/mockec2/routetable.go
Boilerplate header is wrong for: /Users/clove/Workspace/src/k8s.io/kops/cloudmock/aws/mockec2/unimplemented.go

# false positive from  hack/verify-boilerplate.sh, not sure if we need header
Boilerplate header is wrong for: /Users/clove/Workspace/src/k8s.io/kops/federation/model/bindata.go
Boilerplate header is wrong for: /Users/clove/Workspace/src/k8s.io/kops/upup/models/bindata.go

We need to figure out the auto gen code because it does not have a header.

We need this in our CI

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

No branches or pull requests

2 participants