Repository: kubernetes/kubernetes
File: staging/src/k8s.io/code-generator/kube_codegen.sh (Shell)

Code before:
    # used, but not regenerated, unless they are also listed as a "regular"
    # input on the command-line.
    #
    # This list is the same as in kubernetes/kubernetes hack/update-codegen.sh
    local validation_readonly_pkgs=(
        k8s.io/apimachinery/pkg/apis/meta/v1
        k8s.io/apimachinery/pkg/api/resource
        k8s.io/apimachinery/pkg/runtime
        k8s.io/apimachinery/pkg/types
        k8s.io/apimachinery/pkg/util/intstr
        time
    )

    if [ "${#input_pkgs[@]}" != 0 ]; then
        echo "Generating validation code for ${#input_pkgs[@]} targets"

        kube::codegen::internal::findz \
            "${in_dir}" \
            -type f \
            -name zz_generated.validations.go \
            | xargs -0 rm -f

        "${GOBIN}/validation-gen" \
            -v "${v}" \
            --output-file zz_generated.validations.go \
            $(printf -- " --readonly-pkg %s" "${validation_readonly_pkgs[@]}") \
            --go-header-file "${boilerplate}" \
            "${input_pkgs[@]}"
    fi

    # Defaults
    #
    local input_pkgs=()
    while read -r dir; do
        pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
        input_pkgs+=("${pkg}")
    done < <(
        ( kube::codegen::internal::grep -l --null \
            -e '^\s*//\s*+k8s:defaulter-gen=' \
            -r "${in_dir}" \
            --include '*.go' \
            || true \
        ) | while read -r -d $'\0' F; do dirname "${F}"; done \
          | LC_ALL=C sort -u
    )

    if [ "${#input_pkgs[@]}" != 0 ]; then
        echo "Generating defaulter code for ${#input_pkgs[@]} targets"

        kube::codegen::internal::findz \
            "${in_dir}" \

Review comment (suggestion):
```
Status: Downloaded newer image for koalaman/shellcheck@sha256:f35e8987b02760d4e76fc99a68ad5c42cc10bb32f3dd2143a3cf92f1e5446a45
In ./staging/src/k8s.io/code-generator/kube_codegen.sh line 210:
            $(printf -- " --readonly-pkg %s" "${validation_readonly_pkgs[@]}") \
            ^-- SC2046 (warning): Quote this to prevent word splitting.
For more information:
  https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
Please review the above warnings. You can test via "./hack/verify-shellcheck.sh"
```

/lgtm cancel 

Code after:
    # used, but not regenerated, unless they are also listed as a "regular"
    # input on the command-line.
    #
    # This list is the same as in kubernetes/kubernetes hack/update-codegen.sh
    local validation_readonly_pkgs=(
        k8s.io/apimachinery/pkg/apis/meta/v1
        k8s.io/apimachinery/pkg/api/resource
        k8s.io/apimachinery/pkg/runtime
        k8s.io/apimachinery/pkg/types
        k8s.io/apimachinery/pkg/util/intstr
        time
    )

    if [ "${#input_pkgs[@]}" != 0 ]; then
        echo "Generating validation code for ${#input_pkgs[@]} targets"

        kube::codegen::internal::findz \
            "${in_dir}" \
            -type f \
            -name zz_generated.validations.go \
            | xargs -0 rm -f

        "${GOBIN}/validation-gen" \
            -v "${v}" \
            --output-file zz_generated.validations.go \
            "$(printf -- " --readonly-pkg %s" "${validation_readonly_pkgs[@]}")" \
            --go-header-file "${boilerplate}" \
            "${input_pkgs[@]}"
    fi

    # Defaults
    #
    local input_pkgs=()
    while read -r dir; do
        pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
        input_pkgs+=("${pkg}")
    done < <(
        ( kube::codegen::internal::grep -l --null \
            -e '^\s*//\s*+k8s:defaulter-gen=' \
            -r "${in_dir}" \
            --include '*.go' \
            || true \
        ) | while read -r -d $'\0' F; do dirname "${F}"; done \
          | LC_ALL=C sort -u
    )

    if [ "${#input_pkgs[@]}" != 0 ]; then
        echo "Generating defaulter code for ${#input_pkgs[@]} targets"

        kube::codegen::internal::findz \
            "${in_dir}" \