style: Fix style errors
This commit is contained in:
parent
604dfb4ae6
commit
7b0f27ca39
@ -125,7 +125,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def global_option?(name)
|
def global_option?(name)
|
||||||
Homebrew::CLI::Parser.global_options.has_key?(name.to_sym)
|
Homebrew::CLI::Parser.global_options.key?(name.to_sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@ -53,11 +53,11 @@ module Homebrew
|
|||||||
`bump-formula-pr` <options> <formula>:
|
`bump-formula-pr` <options> <formula>:
|
||||||
|
|
||||||
Creates a pull request to update the formula with a new URL or a new tag.
|
Creates a pull request to update the formula with a new URL or a new tag.
|
||||||
|
|
||||||
If a <URL> is specified, the <sha-256> checksum of the new download must
|
If a <URL> is specified, the <sha-256> checksum of the new download must
|
||||||
also be specified. A best effort to determine the <sha-256> and <formula>
|
also be specified. A best effort to determine the <sha-256> and <formula>
|
||||||
name will be made if either or both values are not supplied by the user.
|
name will be made if either or both values are not supplied by the user.
|
||||||
|
|
||||||
If a <tag> is specified, the git commit <revision> corresponding to that
|
If a <tag> is specified, the git commit <revision> corresponding to that
|
||||||
tag must also be specified.
|
tag must also be specified.
|
||||||
|
|
||||||
@ -66,41 +66,43 @@ module Homebrew
|
|||||||
specification, nor vice versa. It must use whichever style specification
|
specification, nor vice versa. It must use whichever style specification
|
||||||
the preexisting formula already uses.
|
the preexisting formula already uses.
|
||||||
EOS
|
EOS
|
||||||
switch "--devel",
|
switch "--devel",
|
||||||
description: "Bump the development rather than stable version. The development spec must already exist."
|
description: "Bump the development rather than stable version. The development spec must already exist."
|
||||||
switch "-n", "--dry-run",
|
switch "-n", "--dry-run",
|
||||||
description: "Print what would be done rather than doing it."
|
description: "Print what would be done rather than doing it."
|
||||||
switch "--write",
|
switch "--write",
|
||||||
description: "When passed along with `--dry-run`, perform a not-so-dry run making the expected "\
|
description: "When passed along with `--dry-run`, perform a not-so-dry run making the expected "\
|
||||||
"file modifications but not taking any git actions."
|
"file modifications but not taking any git actions."
|
||||||
switch "--audit",
|
switch "--audit",
|
||||||
description: "Run `brew audit` before opening the PR."
|
description: "Run `brew audit` before opening the PR."
|
||||||
switch "--strict",
|
switch "--strict",
|
||||||
description: "Run `brew audit --strict` before opening the PR."
|
description: "Run `brew audit --strict` before opening the PR."
|
||||||
switch "--no-browse",
|
switch "--no-browse",
|
||||||
description: "Output the pull request URL instead of opening in a browser"
|
description: "Output the pull request URL instead of opening in a browser"
|
||||||
flag "--url=",
|
flag "--url=",
|
||||||
description: "Provide new <URL> for the formula. If a <URL> is specified, the <sha-256> "\
|
description: "Provide new <URL> for the formula. If a <URL> is specified, the <sha-256> "\
|
||||||
"checksum of the new download must also be specified."
|
"checksum of the new download must also be specified."
|
||||||
flag "--revision=",
|
flag "--revision=",
|
||||||
description: "Specify the new git commit <revision> corresponding to a specified <tag>."
|
description: "Specify the new git commit <revision> corresponding to a specified <tag>."
|
||||||
flag "--tag=", required_for: "--revision=",
|
flag "--tag=",
|
||||||
|
required_for: "--revision=",
|
||||||
description: "Specify the new git commit <tag> for the formula."
|
description: "Specify the new git commit <tag> for the formula."
|
||||||
flag "--sha256=", depends_on: "--url=",
|
flag "--sha256=",
|
||||||
|
depends_on: "--url=",
|
||||||
description: "Specify the <sha-256> checksum of new download."
|
description: "Specify the <sha-256> checksum of new download."
|
||||||
flag "--mirror=",
|
flag "--mirror=",
|
||||||
description: "Use the provided <URL> as a mirror URL."
|
description: "Use the provided <URL> as a mirror URL."
|
||||||
flag "--version=",
|
flag "--version=",
|
||||||
description: "Use the provided <version> to override the value parsed from the URL or tag. Note "\
|
description: "Use the provided <version> to override the value parsed from the URL or tag. Note "\
|
||||||
"that `--version=0` can be used to delete an existing `version` override from a "\
|
"that `--version=0` can be used to delete an existing `version` override from a "\
|
||||||
"formula if it has become redundant."
|
"formula if it has become redundant."
|
||||||
flag "--message=",
|
flag "--message=",
|
||||||
description: "Append provided <message> to the default PR message."
|
description: "Append provided <message> to the default PR message."
|
||||||
|
|
||||||
switch :quiet
|
switch :quiet
|
||||||
switch :force
|
switch :force
|
||||||
switch :verbose
|
switch :verbose
|
||||||
switch :debug
|
switch :debug
|
||||||
conflicts "--url", "--tag"
|
conflicts "--url", "--tag"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -31,7 +31,8 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
switch "--examples",
|
switch "--examples",
|
||||||
description: "Show several examples."
|
description: "Show several examples."
|
||||||
switch "--pry", env: :pry,
|
switch "--pry",
|
||||||
|
env: :pry,
|
||||||
description: "Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set."
|
description: "Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -156,8 +156,10 @@ module Homebrew
|
|||||||
ronn_output = ronn.read
|
ronn_output = ronn.read
|
||||||
odie "Got no output from ronn!" unless ronn_output
|
odie "Got no output from ronn!" unless ronn_output
|
||||||
ronn_output.gsub!(%r{</var>`(?=[.!?,;:]?\s)}, "").gsub!(%r{</?var>}, "`") if format_flag == "--markdown"
|
ronn_output.gsub!(%r{</var>`(?=[.!?,;:]?\s)}, "").gsub!(%r{</?var>}, "`") if format_flag == "--markdown"
|
||||||
ronn_output = ronn_output.gsub(%r{<code>}, "\\fB").gsub(%r{</code>}, "\\fR")
|
unless format_flag == "--markdown"
|
||||||
.gsub(%r{<var>}, "\\fI").gsub(%r{</var>}, "\\fR") unless format_flag == '--markdown'
|
ronn_output = ronn_output.gsub(/<code>/, "\\fB").gsub(%r{</code>}, "\\fR")
|
||||||
|
.gsub(/<var>/, "\\fI").gsub(%r{</var>}, "\\fR")
|
||||||
|
end
|
||||||
target.atomic_write ronn_output
|
target.atomic_write ronn_output
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -192,11 +194,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cmd_arg_parser(cmd_path)
|
def cmd_arg_parser(cmd_path)
|
||||||
"#{cmd_path.basename.to_s.gsub('.rb', '').gsub('-', '_')}_args".to_sym
|
"#{cmd_path.basename.to_s.gsub(".rb", "").tr("-", "_")}_args".to_sym
|
||||||
end
|
end
|
||||||
|
|
||||||
def cmd_manpage_lines(cmd_parser)
|
def cmd_manpage_lines(cmd_parser)
|
||||||
lines = ["#{format_usage_banner(cmd_parser.usage_banner_text)}"]
|
lines = [format_usage_banner(cmd_parser.usage_banner_text)]
|
||||||
lines += cmd_parser.processed_options.map do |short, long, _, desc|
|
lines += cmd_parser.processed_options.map do |short, long, _, desc|
|
||||||
next if !long.nil? && cmd_parser.global_option?(cmd_parser.option_to_name(long))
|
next if !long.nil? && cmd_parser.global_option?(cmd_parser.option_to_name(long))
|
||||||
generate_option_doc(short, long, desc)
|
generate_option_doc(short, long, desc)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ module Homebrew
|
|||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
usage_banner <<~EOS
|
usage_banner <<~EOS
|
||||||
`mirror` <formulae>:
|
`mirror` <formulae>:
|
||||||
|
|
||||||
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
||||||
EOS
|
EOS
|
||||||
switch :debug
|
switch :debug
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#: * `prof` [ruby options]:
|
#: * `prof` [<ruby options>]:
|
||||||
#: Run Homebrew with the Ruby profiler.
|
#: Run Homebrew with the Ruby profiler.
|
||||||
#: For example:
|
#: For example:
|
||||||
#: brew prof readall
|
#: brew prof readall
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|||||||
@ -79,18 +79,18 @@ module Homebrew
|
|||||||
|
|
||||||
Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
||||||
Optionally, installs the formulae changed by the patch.
|
Optionally, installs the formulae changed by the patch.
|
||||||
|
|
||||||
Each <patch-source> may be one of:
|
Each <patch-source> may be one of:
|
||||||
|
|
||||||
~ The ID number of a PR (pull request) in the homebrew/core GitHub
|
~ The ID number of a PR (pull request) in the homebrew/core GitHub
|
||||||
repository
|
repository
|
||||||
|
|
||||||
~ The URL of a PR on GitHub, using either the web page or API URL
|
~ The URL of a PR on GitHub, using either the web page or API URL
|
||||||
formats. In this form, the PR may be on Homebrew/brew,
|
formats. In this form, the PR may be on Homebrew/brew,
|
||||||
Homebrew/homebrew-core or any tap.
|
Homebrew/homebrew-core or any tap.
|
||||||
|
|
||||||
~ The URL of a commit on GitHub
|
~ The URL of a commit on GitHub
|
||||||
|
|
||||||
~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID
|
~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID
|
||||||
EOS
|
EOS
|
||||||
switch "--bottle",
|
switch "--bottle",
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module Homebrew
|
|||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
usage_banner <<~EOS
|
usage_banner <<~EOS
|
||||||
`tap-new` <user>/<repo>:
|
`tap-new` <user>/<repo>:
|
||||||
|
|
||||||
Generate the template files for a new tap.
|
Generate the template files for a new tap.
|
||||||
EOS
|
EOS
|
||||||
switch :debug
|
switch :debug
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#: * test [--devel|--HEAD] [--debug] [--keep-tmp] [formula]:
|
#: * `test` [`--devel`|`--HEAD`] [`--debug`] [`--keep-tmp`] <formula>:
|
||||||
#: Most formulae provide a test method. `brew test` <formula> runs this
|
#: Most formulae provide a test method. `brew test` <formula> runs this
|
||||||
#: test method. There is no standard output or return code, but it should
|
#: test method. There is no standard output or return code, but it should
|
||||||
#: generally indicate to the user if something is wrong with the installed
|
#: generally indicate to the user if something is wrong with the installed
|
||||||
|
|||||||
@ -40,7 +40,7 @@ module Homebrew
|
|||||||
def help(cmd = nil, flags = {})
|
def help(cmd = nil, flags = {})
|
||||||
# Let OptionParser generate help text for commands which have a parser defined
|
# Let OptionParser generate help text for commands which have a parser defined
|
||||||
begin
|
begin
|
||||||
Homebrew.send("#{cmd.gsub('-','_')}_args".to_sym)
|
Homebrew.send("#{cmd.tr("-", "_")}_args".to_sym)
|
||||||
return
|
return
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
nil
|
nil
|
||||||
|
|||||||
@ -832,13 +832,14 @@ Return a failing status code if changes are detected in the manpage outputs. Thi
|
|||||||
It is now done automatically by `brew update`.
|
It is now done automatically by `brew update`.
|
||||||
|
|
||||||
###`mirror` `formulae`:
|
###`mirror` `formulae`:
|
||||||
|
|
||||||
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
||||||
|
|
||||||
|
|
||||||
* `prof` [ruby options]:
|
* `prof` [`ruby options`]:
|
||||||
Run Homebrew with the Ruby profiler.
|
Run Homebrew with the Ruby profiler.
|
||||||
For example:
|
For example:
|
||||||
|
brew prof readall
|
||||||
|
|
||||||
###pull `options` `formula`:
|
###pull `options` `formula`:
|
||||||
|
|
||||||
@ -895,11 +896,11 @@ Output as a Markdown list.
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
###`tap-new` `user`/`repo`:
|
###`tap-new` `user`/`repo`:
|
||||||
|
|
||||||
Generate the template files for a new tap.
|
Generate the template files for a new tap.
|
||||||
|
|
||||||
|
|
||||||
* test [--devel|--HEAD] [--debug] [--keep-tmp] [formula]:
|
* `test` [`--devel`|`--HEAD`] [`--debug`] [`--keep-tmp`] `formula`:
|
||||||
Most formulae provide a test method. `brew test` `formula` runs this
|
Most formulae provide a test method. `brew test` `formula` runs this
|
||||||
test method. There is no standard output or return code, but it should
|
test method. There is no standard output or return code, but it should
|
||||||
generally indicate to the user if something is wrong with the installed
|
generally indicate to the user if something is wrong with the installed
|
||||||
|
|||||||
@ -863,8 +863,8 @@ It is now done automatically by \fBbrew update\fR\.
|
|||||||
Reuploads the stable URL for a formula to Bintray to use it as a mirror\.
|
Reuploads the stable URL for a formula to Bintray to use it as a mirror\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBprof\fR [ruby options]
|
\fBprof\fR [\fIruby options\fR]
|
||||||
Run Homebrew with the Ruby profiler\. For example:
|
Run Homebrew with the Ruby profiler\. For example: brew prof readall
|
||||||
.
|
.
|
||||||
.SS "pull \fIoptions\fR \fIformula\fR:"
|
.SS "pull \fIoptions\fR \fIformula\fR:"
|
||||||
Gets a patch from a GitHub commit or pull request and applies it to Homebrew\. Optionally, installs the formulae changed by the patch\.
|
Gets a patch from a GitHub commit or pull request and applies it to Homebrew\. Optionally, installs the formulae changed by the patch\.
|
||||||
@ -943,7 +943,7 @@ Run a Ruby instance with Homebrew\'s libraries loaded\. For example:
|
|||||||
Generate the template files for a new tap\.
|
Generate the template files for a new tap\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
test [\-\-devel|\-\-HEAD] [\-\-debug] [\-\-keep\-tmp] [formula]
|
\fBtest\fR [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-debug\fR] [\fB\-\-keep\-tmp\fR] \fIformula\fR
|
||||||
Most formulae provide a test method\. \fBbrew test\fR \fIformula\fR runs this test method\. There is no standard output or return code, but it should generally indicate to the user if something is wrong with the installed formula\.
|
Most formulae provide a test method\. \fBbrew test\fR \fIformula\fR runs this test method\. There is no standard output or return code, but it should generally indicate to the user if something is wrong with the installed formula\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user