-
Notifications
You must be signed in to change notification settings - Fork 918
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
Fix verify license lint error #5984
Fix verify license lint error #5984
Conversation
/hold |
Refer to #5357 (comment). We need to confirm if we really need to ignore |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5984 +/- ##
==========================================
- Coverage 48.26% 48.24% -0.02%
==========================================
Files 665 665
Lines 54788 54788
==========================================
- Hits 26442 26434 -8
- Misses 26632 26639 +7
- Partials 1714 1715 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
When I initially modified the code in As for the current issue in the lint tests for verify license in this PR, I noticed that it seems to be related to missing certificate content in some files. I attempted to add the missing certificates to those files and pushed the changes, which seems to have passed the tests. It might not be related to the issue mentioned in #5357. I can try to identify the problem and fix it based on the additional information you provided. |
I checked the #5357 after revert the changes, it doesn't need to ignore the -bash-5.0# hack/verify-license.sh
Congratulations! All files have passed license header check.
-bash-5.0# --- a/hack/verify-license.sh
+++ b/hack/verify-license.sh
@@ -40,7 +40,6 @@ missing_license_header_files="$($ADDLICENSE_BIN \
-ignore "**/*.yml" \
-ignore "**/*.json" \
-ignore ".idea/**" \
- -ignore ".git/**"
.)" || true
if [[ "$missing_license_header_files" ]]; then
|
Signed-off-by: changzhen <[email protected]>
bf014e4
to
e93da66
Compare
Hi @tiansuo114 I modified the missing license file by the way. |
/hold-cancel |
I had the same test results. |
Any chance to improve the script to distinguish the error from -bash-5.0# hack/verify-license.sh
Usage: addlicense [flags] pattern [pattern ...]
The program ensures source code files have copyright license headers
by scanning directory patterns recursively.
It modifies all source files in place and avoids adding a license header
to any file that already has one.
The pattern argument can be provided multiple times, and may also refer
to single files.
Flags:
-c string
copyright holder (default "Google LLC")
-check
check only mode: verify presence of license headers and exit with non-zero code if missing
-f string
license file
-ignore value
file patterns to ignore, for example: -ignore **/*.go -ignore vendor/**
-l string
license type: apache, bsd, mit, mpl (default "apache")
-s Include SPDX identifier in license header. Set -s=only to only include SPDX identifier.
-skip value
[deprecated: see -ignore] file extensions to skip, for example: -skip rb -skip go
-v verbose mode: print the name of the files that are modified or were skipped
-y string
copyright year(s) (default "2024")
hack/verify-license.sh: line 45: .: filename argument required
.: usage: . filename [arguments]
Congratulations! All files have passed license header check. |
Remove the --- a/hack/verify-license.sh
+++ b/hack/verify-license.sh
@@ -41,7 +41,7 @@ missing_license_header_files="$($ADDLICENSE_BIN \
-ignore "**/*.json" \
-ignore ".idea/**" \
-ignore ".git/**"
- .)" || true
+ .) Test it on my own repo:
ref: https://github.com/XiShanYongYe-Chang/karmada/actions/runs/12510379262/job/34901054228 |
/hold cancel |
It is not easy to distinguish whether the
|
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.
ok
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@tiansuo114 would you like to backport this to release-1.12? |
I’m not entirely sure about the meaning of backporting. If you’re referring to synchronizing this change to the release-1.12 branch to address potential issues with the test script, I would support this proposal. Is there anything I can do to help with this process? |
I mean cherry-pick this to branch release-1.12. Here is the guidance. |
OK, I tried to create a cherry-pick PR here. How does it look? |
Looks good, thanks. |
…84-remotes-upstream-release-1.12 Automated cherry pick of #5984: fix verify license lint error
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
I found that some files I did not add licenses, but lint CI did not report errors, so I checked the
hack/verify-license.sh
script.When I run it, it report:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: