Merge pull request #14927 from issyl0/longer-variable-name

Make `str` variable names longer
This commit is contained in:
Issy Long 2023-03-08 16:00:33 +00:00 committed by GitHub
commit 274729156e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -23,8 +23,8 @@ module Homebrew
other =~ @text
end
def include?(str)
@text.include? str
def include?(string)
@text.include? string
end
def to_s

View File

@ -50,10 +50,10 @@ module Formatter
# so we always wrap one word before an option.
# @see https://github.com/Homebrew/brew/pull/12672
# @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/
def format_help_text(str, width: 172)
def format_help_text(string, width: 172)
desc = OPTION_DESC_WIDTH
indent = width - desc
str.gsub(/(?<=\S) *\n(?=\S)/, " ")
string.gsub(/(?<=\S) *\n(?=\S)/, " ")
.gsub(/([`>)\]]:) /, "\\1\n ")
.gsub(/^( +-.+ +(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")
.gsub(/^( {#{indent}}(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")