mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #65467 from foo0x29a/master
Automatic merge from submit-queue (batch tested with PRs 60150, 65467, 65487, 65595, 65374). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Pick the first extension matched **What this PR does / why we need it**: Since it's possible to match only one file extension, change the ```if``` statement in order to check the condition only once. **Release note**: ```release-note NONE ```
This commit is contained in:
commit
1f3c7bc2cd
@ -93,13 +93,11 @@ def file_passes(filename, refs, regexs):
|
||||
else:
|
||||
ref = refs[basename]
|
||||
|
||||
# remove build tags from the top of Go files
|
||||
if extension == "go" or extension =="generatego":
|
||||
# remove extra content from the top of files
|
||||
if extension == "go" or extension == "generatego":
|
||||
p = regexs["go_build_constraints"]
|
||||
(data, found) = p.subn("", data, 1)
|
||||
|
||||
# remove shebang from the top of shell files
|
||||
if extension == "sh":
|
||||
elif extension == "sh":
|
||||
p = regexs["shebang"]
|
||||
(data, found) = p.subn("", data, 1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user