-
Notifications
You must be signed in to change notification settings - Fork 105
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 license-check for .go , .sh , Dockerfile and Makefile #205
Conversation
Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
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. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline here as well
upgrade/cleanup.sh
Outdated
@@ -1,3 +1,17 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this extra line
upgrade/upgrade.sh
Outdated
@@ -1,3 +1,17 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this extra line
# 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line after this
# 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line after this
# 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line after this
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// +build tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this tag top of the file following by the new line similar to cstor-operators repo
@@ -1,3 +1,17 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
# 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line after this
Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
buildscripts/tools.go
Outdated
limitations under the License. | ||
|
||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license got added 2 times here
buildscripts/build.sh
Outdated
# 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. | ||
|
||
#!/usr/bin/env bash | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#!/usr/bin/env bash
# Copyright 2020 The OpenEBS Authors. All rights reserved.
#
# 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.
# This script builds the application from source for multiple platforms.
set -e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can arrange the build.sh file like above
Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #205 +/- ##
=========================================
- Coverage 9.88% 9.82% -0.07%
=========================================
Files 20 20
Lines 1163 1171 +8
=========================================
Hits 115 115
- Misses 1047 1055 +8
Partials 1 1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -246,3 +246,16 @@ golint: | |||
@echo "Completed golint no recommendations !!" | |||
@echo "--------------------------------" | |||
@echo "" | |||
|
|||
.PHONY: license-check | |||
license-check: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this target in make all
command.
all: license-check test manifests zfs-driver-image
license-check: | ||
@echo "--> Checking license header..." | ||
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \ | ||
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is generated|GENERATED, why we are checking fot this? @prateekpandey14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for generated files, which may or may not have license , but check can ignore those files.
Signed-off-by: ajeetrai707 <ajeetrai707@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. Thanks for this PR @AJEETRAI707 .
Signed-off-by: ajeetrai707 ajeetrai707@gmail.com
Pull Request template
Please, go through these steps before you submit a PR.
Why is this PR required? What issue does it fix?:
This PR is to Add license-check for .go , .sh , Dockerfile and Makefile.
What this PR does?:
This PR check for license for .go , .sh , Dockerfile and Makefile.
If license found then build passes , else build fails.
Command to check license is
make license-check
Does this PR require any upgrade changes?:
If the changes in this PR are manually verified, list down the scenarios covered::
Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Checklist:
<type>(<scope>): <subject>
PLEASE REMOVE BELOW INFORMATION BEFORE SUBMITTING
The PR title message must follow convention:
<type>(<scope>): <subject>
.Where:
type
is defining if release will be triggering after merging submitted changes, details in CONTRIBUTING.md.Most common types are:
feat
- for new features, not a new feature for build scriptfix
- for bug fixes or improvements, not a fix for build scriptchore
- changes not related to production codedocs
- changes related to documentationstyle
- formatting, missing semi colons, linting fix etc; no significant production code changestest
- adding missing tests, refactoring tests; no production code changerefactor
- refactoring production code, eg. renaming a variable or function name, there should not be any significant production code changesscope
is a single word that best describes where the changes fit.Most common scopes are like:
localpv
,jiva
,cstor
)provisioning
,backup
,restore
,exporter
)api
,webhook
,cast
,upgrade
)tests
,bdd
)version
,build
,log
,travis
)subject
is a single line brief description of the changes made in the pull request.