mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 18:28:13 +00:00 
			
		
		
		
	Make update-gofmt use ls-files
This commit is contained in:
		| @@ -27,20 +27,17 @@ kube::golang::verify_go_version | ||||
|  | ||||
| cd "${KUBE_ROOT}" | ||||
|  | ||||
| find_files() { | ||||
|   find . -not \( \ | ||||
|       \( \ | ||||
|         -wholename './output' \ | ||||
|         -o -wholename './.git' \ | ||||
|         -o -wholename './_output' \ | ||||
|         -o -wholename './_gopath' \ | ||||
|         -o -wholename './release' \ | ||||
|         -o -wholename './target' \ | ||||
|         -o -wholename '*/third_party/*' \ | ||||
|         -o -wholename '*/vendor/*' \ | ||||
|         -o -wholename './staging/src/k8s.io/client-go/*vendor/*' \ | ||||
|       \) -prune \ | ||||
|     \) -name '*.go' | ||||
| function git_find() { | ||||
|     # Similar to find but faster and easier to understand.  We want to include | ||||
|     # modified and untracked files because this might be running against code | ||||
|     # which is not tracked by git yet. | ||||
|     git ls-files -cmo --exclude-standard \ | ||||
|         ':!:vendor/*'        `# catches vendor/...` \ | ||||
|         ':!:*/vendor/*'      `# catches any subdir/vendor/...` \ | ||||
|         ':!:third_party/*'   `# catches third_party/...` \ | ||||
|         ':!:*/third_party/*' `# catches third_party/...` \ | ||||
|         ':(glob)**/*.go' \ | ||||
|         "$@" | ||||
| } | ||||
|  | ||||
| find_files | xargs gofmt -s -w | ||||
| git_find -z | xargs -0 gofmt -s -w | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tim Hockin
					Tim Hockin