Skip to content

Refactor: Unify the pattern of the string concatenations spanning the line breaks #131558

Open
@logica0419

Description

@logica0419

/kind cleanup

Why we need it:

ref: #131286

There are two types of string concatenations spanning the line breaks.

  1. Insert whitespace / \n at the last of the upper line
fs.StringVar(&o.ServiceAccounts.JWKSURI, "service-account-jwks-uri", o.ServiceAccounts.JWKSURI, ""+
	"Overrides the URI for the JSON Web Key Set in the discovery doc served at "+
	"/.well-known/openid-configuration. This flag is useful if the discovery doc "+
	"and key set are served to relying parties from a URL other than the "+
	"API server's external (as auto-detected or overridden with external-hostname).")
  1. Insert whitespace / \n at the beginning of the lower line
fs.StringVar(&o.ServiceAccounts.JWKSURI, "service-account-jwks-uri", o.ServiceAccounts.JWKSURI, ""+
	"Overrides the URI for the JSON Web Key Set in the discovery doc served at"+
	" /.well-known/openid-configuration. This flag is useful if the discovery doc"+
	" and key set are served to relying parties from a URL other than the"+
	" API server's external (as auto-detected or overridden with external-hostname).")

The inconsistency of the concatenation sometimes causes the missing whitespace, like this.
https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/#:~:text=%2D%2Dservice%2Daccount%2Djwks%2Duri
IMG_0253

With a few inspections, I assumed the first one (Insert whitespace / \n at the last of the upper line) is the current majority.
All the second patterns can be searched by a regex [^" (]"\+\n (and excluding the line ends with \n)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.sig/architectureCategorizes an issue or PR as relevant to SIG Architecture.sig/contributor-experienceCategorizes an issue or PR as relevant to SIG Contributor Experience.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions