diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 278ec1382c..87dd29f494 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1,6 +1,7 @@ #: * `audit` [`--strict`] [`--fix`] [`--online`] [`--new-formula`] [`--display-cop-names`] [`--display-filename`] [`--only=`|`--except=`] [`--only-cops=`|`--except-cops=`] []: -#: Check for Homebrew coding style violations. This should be -#: run before submitting a new formula. +#: Check for Homebrew coding style violations. This should be run +#: before submitting a new formula. Will exit with a non-zero status if any errors +#: are found, which can be useful for implementing pre-commit hooks. #: #: If no are provided, all of them are checked. #: @@ -23,16 +24,13 @@ #: If `--display-filename` is passed, every line of output is prefixed with the #: name of the file or formula being audited, to make the output easy to grep. #: -#: Passing `--only=` will run only the methods named `audit_`, -#: while `--except=` will skip the methods named `audit_`. +#: Specifying `--only=` will run only the methods named `audit_`, +#: while `--except=` will skip the methods named `audit_`. #: For either option should be a comma-separated list. #: -#: Passing `--only-cops=` will check for violations of only the listed +#: Specifying `--only-cops=` will check for violations of only the listed #: RuboCop , while `--except-cops=` will skip checking the listed #: . For either option should be a comma-separated list of cop names. -#: -#: `audit` exits with a non-zero status if any errors are found. This is useful, -#: for instance, for implementing pre-commit hooks. # Undocumented options: # `-D` activates debugging and profiling of the audit methods (not the same as `--debug`) @@ -57,12 +55,13 @@ module Homebrew usage_banner <<~EOS `audit` [] : - Check for Homebrew coding style violations. This should be - run before submitting a new formula. + Check for Homebrew coding style violations. This should be run before + submitting a new formula. Will exit with a non-zero status if any errors are + found, which can be useful for implementing pre-commit hooks. If no are provided, all of them are checked. EOS switch "--strict", - description: "Run additional style checks, including Rubocop style checks." + description: "Run additional style checks, including RuboCop style checks." switch "--online", description: "Run additional slower style checks that require a network connection." switch "--new-formula", @@ -74,24 +73,26 @@ module Homebrew switch "--display-cop-names", description: "Include the RuboCop cop name for each violation in the output." switch "--display-filename", - description: "Prefix everyline of output with name of the file or formula being audited, to "\ + description: "Prefix every line of output with name of the file or formula being audited, to "\ "make output easy to grep." switch "-D", "--audit-debug", - description: "Activates debugging and profiling" + description: "Enable debugging and profiling of audit methods." comma_array "--only", - description: "Passing `--only=` will run only the methods named audit_. "\ - " should be a comma-separated list." + description: "Specify a comma-separated list to only run the methods named "\ + "`audit_`." comma_array "--except", - description: "Passing `--except=` will run only the methods named audit_, "\ - " should be a comma-separated list." + description: "Specify a comma-separated list to skip running the methods named "\ + "`audit_`." comma_array "--only-cops", - description: "Passing `--only-cops=` will check for violations of only the listed "\ - "RuboCop cops. should be a comma-separated list of cop names." + description: "Specify a comma-separated list to check for violations of only the listed "\ + "RuboCop cops." comma_array "--except-cops", - description: "Passing `--except-cops=` will skip checking the listed RuboCop cops "\ - "violations. should be a comma-separated list of cop names." + description: "Specify a comma-separated list to skip checking for violations of the listed "\ + "RuboCop cops." switch :verbose switch :debug + conflicts "--only", "--except" + conflicts "--only-cops", "--except-cops" end end @@ -126,7 +127,7 @@ module Homebrew if only_cops && except_cops odie "--only-cops and --except-cops cannot be used simultaneously!" elsif (only_cops || except_cops) && (strict || args.only) - odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously" + odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously!" end options = { fix: args.fix?, realpath: true } diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 3f43214f02..13c1fcddf4 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -1,10 +1,10 @@ #: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--or-later`] [`--root-url=`] [`--force-core-tap`] [`--json`] : -#: Generate a bottle (binary package) from a formula installed with +#: Generate a bottle (binary package) from a formula that was installed with #: `--build-bottle`. #: #: If the formula specifies a rebuild version, it will be incremented in the -#: generated DSL. Passing `--keep-old` will attempt to keep it at its -#: original value, while `--no-rebuild` will remove it. +#: generated DSL. Passing `--keep-old` will attempt to keep it at its original +#: value, while `--no-rebuild` will remove it. #: #: If `--verbose` (or `-v`) is passed, print the bottling commands and any warnings #: encountered. @@ -15,7 +15,7 @@ #: If `--root-url` is passed, use the specified as the root of the #: bottle's URL instead of Homebrew's default. #: -#: If `--or-later` is passed, append _or_later to the bottle tag. +#: If `--or-later` is passed, append `_or_later` to the bottle tag. #: #: If `--force-core-tap` is passed, build a bottle even if is not #: in homebrew/core or any installed taps. @@ -74,11 +74,11 @@ module Homebrew usage_banner <<~EOS `bottle` [] : - Generate a bottle (binary package) from a formula installed with + Generate a bottle (binary package) from a formula that was installed with `--build-bottle`. If the formula specifies a rebuild version, it will be incremented in the - generated DSL. Passing `--keep-old` will attempt to keep it at its - original value, while `--no-rebuild` will remove it. + generated DSL. Passing `--keep-old` will attempt to keep it at its original + value, while `--no-rebuild` will remove it. EOS switch "--skip-relocation", description: "Do not check if the bottle can be marked as relocatable." @@ -87,28 +87,30 @@ module Homebrew switch "--force-core-tap", description: "Build a bottle even if is not in homebrew/core or any installed taps." switch "--no-rebuild", - description: "If the formula specifies a rebuild version, it will be removed in the generated DSL." + description: "If the formula specifies a rebuild version, remove it from the generated DSL." switch "--keep-old", - description: "If the formula specifies a rebuild version, it will attempted to be kept in the "\ - " generated DSL." - switch "--merge", - description: "Generate a bottle from a formula and print the new DSL merged into the "\ - "existing formula." - switch "--write", - description: "Changes will be written to the formula file. A new commit will be generated unless "\ - "`--no-commit` is passed." - switch "--no-commit", - description: "When passed with `--write`, a new commit will not generated while writing changes "\ - "to the formula file.", - depends_on: "--write" + description: "If the formula specifies a rebuild version, attempt to preserve its value in the "\ + "generated DSL." switch "--json", description: "Write bottle information to a JSON file, which can be used as the argument for "\ "`--merge`." + switch "--merge", + description: "Generate an updated bottle block for a formula and optionally merge it into the "\ + "formula file. Instead of a formula name, requires a JSON file generated with "\ + "`brew bottle --json` ." + switch "--write", + depends_on: "--merge", + description: "Write the changes to the formula file. A new commit will be generated unless "\ + "`--no-commit` is passed." + switch "--no-commit", + depends_on: "--write", + description: "When passed with `--write`, a new commit will not generated after writing changes "\ + "to the formula file." flag "--root-url", - description: "Use the specified as the root of the bottle's URL instead of Homebrew's "\ - "default." + description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." switch :verbose switch :debug + conflicts "--no-rebuild", "--keep-old" end end @@ -228,7 +230,7 @@ module Homebrew unless tap = f.tap unless args.force_core_tap? - return ofail "Formula not from core or any taps: #{f.full_name}" + return ofail "Formula not from core or any installed taps: #{f.full_name}" end tap = CoreTap.instance diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 16f3d24af6..e5f4838f53 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -1,11 +1,11 @@ -#: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--audit`|`--strict`] [`--mirror=`] [`--version=`] [`--message=`] (`--url=` `--sha256=`|`--tag=` `--revision=`) : -#: Creates a pull request to update the formula with a new URL or a new tag. +#: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--audit`|`--strict`] [`--no-browse] [`--mirror=`] [`--version=`] [`--message=`] (`--url=` `--sha256=`|`--tag=` `--revision=`) []: +#: Create a pull request to update a formula with a new URL or a new tag. #: -#: If a is specified, the checksum of the new download must -#: also be specified. A best effort to determine the and +#: If a is specified, the checksum of the new download should +#: also be specified. A best effort to determine the and #: name will be made if either or both values are not supplied by the user. #: -#: If a is specified, the git commit corresponding to that +#: If a is specified, the Git commit corresponding to that #: tag must also be specified. #: #: If `--devel` is passed, bump the development rather than stable version. @@ -13,8 +13,8 @@ #: #: If `--dry-run` is passed, print what would be done rather than doing it. #: -#: If `--write` is passed along with `--dry-run`, perform a not-so-dry run -#: making the expected file modifications but not taking any git actions. +#: If `--write` is passed along with `--dry-run`, perform a not-so-dry run by +#: making the expected file modifications but not taking any Git actions. #: #: If `--audit` is passed, run `brew audit` before opening the PR. #: @@ -24,7 +24,7 @@ #: #: If `--version=` is passed, use the value 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 formula if it has become redundant. +#: an existing version override from a formula if it has become redundant. #: #: If `--message=` is passed, append to the default PR #: message. @@ -36,8 +36,8 @@ #: If `--quiet` is passed, don't output replacement messages or warn about #: duplicate pull requests. #: -#: Note that this command cannot be used to transition a formula from a -#: URL-and-sha256 style specification into a tag-and-revision style +#: *Note:* this command cannot be used to transition a formula from a +#: URL-and-SHA-256 style specification into a tag-and-revision style #: specification, nor vice versa. It must use whichever style specification #: the preexisting formula already uses. @@ -50,57 +50,58 @@ module Homebrew def bump_formula_pr_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `bump-formula-pr` [] : + `bump-formula-pr` [] []: - Creates a pull request to update the formula with a new URL or a new tag. + Create a pull request to update a formula with a new URL or a new tag. - If a is specified, the checksum of the new download must - also be specified. A best effort to determine the and - name will be made if either or both values are not supplied by the user. + If a is specified, the checksum of the new download should also + be specified. A best effort to determine the and name will + be made if either or both values are not supplied by the user. - If a is specified, the git commit corresponding to that - tag must also be specified. + If a is specified, the Git commit corresponding to that tag + must also be specified. - Note that this command cannot be used to transition a formula from a - URL-and-sha256 style specification into a tag-and-revision style - specification, nor vice versa. It must use whichever style specification - the preexisting formula already uses. + *Note:* this command cannot be used to transition a formula from a + URL-and-SHA-256 style specification into a tag-and-revision style specification, + nor vice versa. It must use whichever style specification the preexisting + formula already uses. EOS switch "--devel", description: "Bump the development rather than stable version. The development spec must already exist." switch "-n", "--dry-run", description: "Print what would be done rather than doing it." switch "--write", - description: "When passed along with `--dry-run`, perform a not-so-dry run making the expected "\ - "file modifications but not taking any git actions." + depends_on: "--dry-run", + description: "When passed along with `--dry-run`, perform a not-so-dry run by making the expected "\ + "file modifications but not taking any Git actions." switch "--audit", description: "Run `brew audit` before opening the PR." switch "--strict", description: "Run `brew audit --strict` before opening the PR." switch "--no-browse", - description: "Output the pull request URL instead of opening in a browser" - flag "--url=", - description: "Provide new for the formula. If a is specified, the "\ - "checksum of the new download must also be specified." - flag "--revision=", - description: "Specify the new git commit corresponding to a specified ." - flag "--tag=", - required_for: "--revision=", - description: "Specify the new git commit for the formula." - flag "--sha256=", - depends_on: "--url=", - description: "Specify the checksum of new download." - flag "--mirror=", + description: "Print the pull request URL instead of opening in a browser." + flag "--mirror=", description: "Use the provided as a mirror URL." - flag "--version=", + flag "--version=", description: "Use the provided 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." - flag "--message=", - description: "Append provided to the default PR message." + flag "--message=", + description: "Append the provided to the default PR message." + flag "--url=", + description: "Specify the for the new download. If a is specified, the "\ + "checksum of the new download should also be specified." + flag "--sha256=", + depends_on: "--url=", + description: "Specify the checksum of the new download." + flag "--tag=", + description: "Specify the new git commit for the formula." + flag "--revision=", + required_for: "--tag=", + description: "Specify the new git commit corresponding to a specified ." - switch :quiet switch :force + switch :quiet switch :verbose switch :debug conflicts "--url", "--tag" @@ -352,7 +353,7 @@ module Homebrew "#{new_formula_version}#{devel_message}' -- #{formula.path}" ohai "git push --set-upstream $HUB_REMOTE #{branch}:#{branch}" ohai "create pull request with GitHub API" - ohai "git checkout -" + ohai "git checkout --quiet -" else begin diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 4d65c8f416..14dc681d39 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -1,17 +1,17 @@ -#: * `create` [`--autotools`|`--cmake`|`--meson`] [`--no-fetch`] [`--set-name` ] [`--set-version` ] [`--tap` `/`]: +#: * `create` [`--autotools`|`--cmake`|`--meson`] [`--no-fetch`] [`--set-name` ] [`--set-version` ] [`--tap` `/`] : #: Generate a formula for the downloadable file at and open it in the editor. #: Homebrew will attempt to automatically derive the formula name #: and version, but if it fails, you'll have to make your own template. The `wget` -#: formula serves as a simple example. For the complete API have a look at -#: . +#: formula serves as a simple example. For the complete API, see: +#: #: #: If `--autotools` is passed, create a basic template for an Autotools-style build. #: If `--cmake` is passed, create a basic template for a CMake-style build. #: If `--meson` is passed, create a basic template for a Meson-style build. #: #: If `--no-fetch` is passed, Homebrew will not download to the cache and -#: will thus not add the SHA256 to the formula for you. It will also not check -#: the GitHub API for GitHub projects (to fill out the description and homepage). +#: will thus not add the SHA-256 to the formula for you, nor will it check +#: the GitHub API for GitHub projects (to fill out its description and homepage). #: #: The options `--set-name` and `--set-version` each take an argument and allow #: you to explicitly set the name and version of the package you are creating. @@ -30,13 +30,13 @@ module Homebrew def create_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `create` []: + `create` [] : Generate a formula for the downloadable file at and open it in the editor. - Homebrew will attempt to automatically derive the formula name - and version, but if it fails, you'll have to make your own template. The `wget` - formula serves as a simple example. For the complete API have a look at - . + Homebrew will attempt to automatically derive the formula name and version, but + if it fails, you'll have to make your own template. The `wget` formula serves as + a simple example. For the complete API, see: + EOS switch "--autotools", description: "Create a basic template for an Autotools-style build." @@ -45,17 +45,17 @@ module Homebrew switch "--meson", description: "Create a basic template for a Meson-style build." switch "--no-fetch", - description: "Homebrew will not download to the cache and will thus not add the SHA256 to "\ - "the formula for you. It will also not check the GitHub API for GitHub projects "\ - "(to fill out the description and homepage)." - switch "--HEAD" + description: "Homebrew will not download to the cache and will thus not add the SHA-256 "\ + "to the formula for you, nor will it check the GitHub API for GitHub projects "\ + "(to fill out its description and homepage)." + switch "--HEAD", + description: "Indicate that points to the package's repository rather than a file." flag "--set-name=", - description: "Set the provided name of the package you are creating." + description: "Set the name of the new formula to the provided ." flag "--set-version=", - description: "Set the provided version of the package you are creating." + description: "Set the version of the new formula to the provided ." flag "--tap=", - description: "Takes a tap [`/`] as argument and generates the formula in the "\ - "specified tap." + description: "Generate the new formula in the provided tap, specified as `/`." switch :force switch :verbose switch :debug diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 42d7ecf941..f0fb0c759d 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -1,8 +1,8 @@ #: * `edit`: -#: Open all of Homebrew for editing. +#: Open the Homebrew repository for editing. #: #: * `edit` : -#: Open in the editor. +#: Open in the editor set by `EDITOR` or `HOMEBREW_EDITOR`. require "formula" require "cli_parser" @@ -13,9 +13,10 @@ module Homebrew def edit_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `edit` : - Open in the editor. Open all of Homebrew for editing if - no is provided. + `edit` []: + + Open a formula in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the + Homebrew repository for editing if no is provided. EOS switch :force switch :verbose @@ -29,7 +30,7 @@ module Homebrew unless (HOMEBREW_REPOSITORY/".git").directory? raise <<~EOS Changes will be lost! - The first time you `brew update', all local changes will be lost, you should + The first time you `brew update', all local changes will be lost; you should thus `brew update' before you `brew edit'! EOS end diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index 3e4813fdd8..365cdca57f 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -1,7 +1,7 @@ #: * `extract` [`--force`] [`--version=`]: -#: Looks through repository history to find the of and -#: creates a copy in /Formula/@.rb. If the tap is -#: not installed yet, attempts to install/clone the tap before continuing. +#: Look through repository history to find the most recent version of and +#: create a copy in `/Formula/``@``.rb`. If the tap is +#: not installed yet, attempt to install/clone the tap before continuing. #: #: If `--force` is passed, the file at the destination will be overwritten #: if it already exists. Otherwise, existing files will be preserved. @@ -101,16 +101,15 @@ module Homebrew usage_banner <<~EOS `extract` [] : - Looks through repository history to find the of and - creates a copy in /Formula/@.rb. If the tap is - not installed yet, attempts to install/clone the tap before continuing. + Look through repository history to find the most recent version of and + create a copy in `/Formula/``@``.rb`. If the tap is not + installed yet, attempt to install/clone the tap before continuing. EOS flag "--version=", - description: "Provided of will be extracted and placed in the destination "\ - "tap. Otherwise, the most recent version that can be found will be used." - switch :debug + description: "Extract the provided of instead of the most recent." switch :force + switch :debug end end @@ -128,7 +127,7 @@ module Homebrew repo = CoreTap.instance.path # Formulae can technically live in "/.rb" or # "/Formula/.rb", but explicitly use the latter for now - # since that is now core tap is structured. + # since that is how the core tap is structured. file = repo/"Formula/#{name}.rb" if args.version @@ -175,7 +174,7 @@ module Homebrew odie <<~EOS Destination formula already exists: #{path} To overwrite it and continue anyways, run: - `brew extract #{name} --version=#{version} --tap=#{destination_tap.name} --force` + brew extract --force --version=#{version} #{name} #{destination_tap.name} EOS end ohai "Overwriting existing formula at #{path}" if ARGV.debug? diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index 904f8e2aa6..71e984ef66 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -1,5 +1,5 @@ -#: * `formula` : -#: Display the path where is located. +#: * `formula` : +#: Display the path where a formula is located. require "formula" require "cli_parser" @@ -10,12 +10,12 @@ module Homebrew def formula_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `formula` : + `formula` : - Display the path where is located. + Display the path where a formula is located. EOS - switch :debug switch :verbose + switch :debug end end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 816ab6047c..62794092eb 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -2,8 +2,9 @@ #: Enter the interactive Homebrew Ruby shell. #: #: If `--examples` is passed, several examples will be shown. -#: If `--pry` is passed or HOMEBREW_PRY is set, pry will be -#: used instead of irb. +#: +#: If `--pry` is passed or `HOMEBREW_PRY` is set, Pry will be +#: used instead of IRB. require "cli_parser" @@ -33,7 +34,7 @@ module Homebrew description: "Show several examples." switch "--pry", env: :pry, - description: "Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set." + description: "Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set." end end diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 2feb98f899..7a8fdb7352 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -1,14 +1,12 @@ #: * `linkage` [`--test`] [`--reverse`] []: -#: Checks the library links of installed formulae. -#: -#: Only works on installed formulae. An error is raised if it is run on -#: uninstalled formulae. +#: Check the library links for kegs of installed formulae. +#: Raises an error if run on uninstalled formulae. #: #: If `--test` is passed, only display missing libraries and exit with a -#: non-zero exit code if any missing libraries were found. +#: non-zero status if any missing libraries are found. #: -#: If `--reverse` is passed, print the dylib followed by the binaries -#: which link to it for each library the keg references. +#: If `--reverse` is passed, for every library that a keg references, +#: print its dylib path followed by the binaries that link to it. #: #: If are given, check linkage for only the specified brews. @@ -22,21 +20,19 @@ module Homebrew def linkage_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `linkage` [] : + `linkage` [] []: - Checks the library links of an installed formula. - - Only works on installed formulae. An error is raised if it is run on - uninstalled formulae. + Check the library links for kegs of installed formulae. + Raises an error if run on uninstalled formulae. EOS switch "--test", - description: "Display only missing libraries and exit with a non-zero exit code if any missing "\ - "libraries were found." + description: "Display only missing libraries and exit with a non-zero status if any missing "\ + "libraries are found." switch "--reverse", - description: "Print the dylib followed by the binaries which link to it for each library the keg "\ - "references." + description: "For every library that a keg references, print its dylib path followed by the "\ + "binaries that link to it." switch "--cached", - description: "Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous "\ + description: "Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous "\ "`brew linkage` run." switch :verbose switch :debug diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index d11780923f..332b3438ae 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -47,7 +47,7 @@ module Homebrew "the date used in new manpages will match those in the existing manpages (to allow "\ "comparison without factoring in the date)." switch "--link", - description: "It is now done automatically by `brew update`." + description: "This is now done automatically by `brew update`." end end @@ -220,7 +220,7 @@ module Homebrew end def generate_option_doc(short, long, desc) - "* #{format_short_opt(short)} #{format_long_opt(long)}:" + "\n" + desc + "\n" + "* #{format_short_opt(short)}#{format_long_opt(long)}:" + "\n " + desc + "\n" end def format_short_opt(opt) diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index a707e1dc7e..e84f903ec5 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -14,15 +14,15 @@ module Homebrew Reuploads the stable URL for a formula to Bintray to use it as a mirror. EOS - switch :debug switch :verbose + switch :debug end end def mirror mirror_args.parse - odie "This command requires at least formula argument!" if ARGV.named.empty? + odie "This command requires at least one formula argument!" if ARGV.named.empty? bintray_user = ENV["HOMEBREW_BINTRAY_USER"] bintray_key = ENV["HOMEBREW_BINTRAY_KEY"] diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 1779be9478..bfd63ba0c2 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -1,6 +1,6 @@ #: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=`] [`--test-bot-user=`] []: -#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew. -#: Optionally, installs the formulae changed by the patch. +#: Get a patch from a GitHub commit or pull request and apply it to Homebrew. +#: Optionally, publish updated bottles for the formulae changed by the patch. #: #: Each may be one of: #: @@ -41,11 +41,11 @@ #: If `--warn-on-publish-failure` was passed, do not exit if there's a #: failure publishing bottles on Bintray. #: -#: If `--bintray-org=` is passed, publish at the given Bintray +#: If `--bintray-org=` is passed, publish at the provided Bintray #: organisation. #: #: If `--test-bot-user=` is passed, pull the bottle block -#: commit from the specified user on GitHub. +#: commit from the provided user on GitHub. require "net/http" require "net/https" @@ -74,12 +74,12 @@ module Homebrew def pull_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `pull` [] : + `pull` [] : - Gets a patch from a GitHub commit or pull request and applies it to Homebrew. - Optionally, installs the formulae changed by the patch. + Get a patch from a GitHub commit or pull request and apply it to Homebrew. + Optionally, publish updated bottles for the formulae changed by the patch. - Each may be one of: + Each may be one of: ~ The ID number of a PR (pull request) in the homebrew/core GitHub repository @@ -112,9 +112,9 @@ module Homebrew switch "--warn-on-publish-failure", description: "Do not exit if there's a failure publishing bottles on Bintray." flag "--bintray-org=", - description: "Publish at the given Bintray organisation." + description: "Publish bottles at the provided Bintray ." flag "--test-bot-user=", - description: "Pull the bottle block commit from the specified user on GitHub." + description: "Pull the bottle block commit from the provided on GitHub." switch :verbose switch :debug end diff --git a/Library/Homebrew/dev-cmd/release-notes.rb b/Library/Homebrew/dev-cmd/release-notes.rb index 2a990a8617..c52ed90df7 100644 --- a/Library/Homebrew/dev-cmd/release-notes.rb +++ b/Library/Homebrew/dev-cmd/release-notes.rb @@ -1,9 +1,9 @@ #: * `release-notes` [`--markdown`] [] []: -#: Output the merged pull requests on Homebrew/brew between two Git refs. +#: Print the merged pull requests on Homebrew/brew between two Git refs. #: If no is provided it defaults to the latest tag. #: If no is provided it defaults to `origin/master`. #: -#: If `--markdown` is passed, output as a Markdown list. +#: If `--markdown` is passed, print as a Markdown list. require "cli_parser" @@ -15,12 +15,12 @@ module Homebrew usage_banner <<~EOS `release-notes` [] [] []: - Output the merged pull requests on Homebrew/brew between two Git refs. + Print the merged pull requests on Homebrew/brew between two Git refs. If no is provided it defaults to the latest tag. If no is provided it defaults to `origin/master`. EOS switch "--markdown", - description: "Output as a Markdown list." + description: "Print as a Markdown list." end end diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 92ff6a40b9..4165d44738 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -7,23 +7,15 @@ require "cli_parser" module Homebrew module_function - def write_path(tap, filename, content) - path = tap.path/filename - tap.path.mkpath - raise "#{path} already exists" if path.exist? - - path.write content - end - def tap_new_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `tap-new` /: + `tap-new` `/`: Generate the template files for a new tap. EOS - switch :debug switch :verbose + switch :debug end end @@ -84,4 +76,12 @@ module Homebrew YAML write_path(tap, ".travis.yml", travis) end + + def write_path(tap, filename, content) + path = tap.path/filename + tap.path.mkpath + raise "#{path} already exists" if path.exist? + + path.write content + end end diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index add193d968..d48dbced34 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -1,6 +1,6 @@ -#: * `tests` [`--verbose`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`[`:`]] [`--seed=`] [`--online`] [`--official-cmd-taps`]: +#: * `tests` [`--verbose`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`[`:`]] [`--seed=`] [`--online`]: #: Run Homebrew's unit and integration tests. If provided, -#: `--only=` runs only _spec.rb, and `--seed` +#: `--only=` runs only `_spec.rb`, and `--seed` #: randomizes tests with the provided value instead of a random seed. #: #: If `--verbose` (or `-v`) is passed, print the command that runs the tests. @@ -26,23 +26,22 @@ module Homebrew usage_banner <<~EOS `tests` []: - Run Homebrew's unit and integration tests. If provided, - `--only=` runs only _spec.rb, and `--seed` - randomizes tests with the provided value instead of a random seed. + Run Homebrew's unit and integration tests. EOS switch "--coverage", description: "Generate code coverage reports." switch "--generic", - description: "Run only OS-agnostic tests." + description: "Run only OS-agnostic tests." switch "--no-compat", description: "Do not load the compatibility layer when running tests." switch "--online", description: "Include tests that use the GitHub API and tests that use any of the taps for "\ "official external commands." flag "--only=", - description: "Run only _spec.rb" + description: "Run only `_spec.rb`. Appending `:` will start at a "\ + "specific line." flag "--seed=", - description: "Randomizes tests with the provided value instead of a random seed." + description: "Randomize tests with the provided instead of a random seed." switch :verbose switch :debug end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index c9aec5b31a..3bc9a8a766 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -1,5 +1,5 @@ #: * `update-test` [`--commit=`] [`--before=`] [`--to-tag`] [`--keep-tmp`]: -#: Runs a test of `brew update` with a new repository clone. +#: Run a test of `brew update` with a new repository clone. #: #: If no arguments are passed, use `origin/master` as the start commit. #: @@ -24,8 +24,7 @@ module Homebrew usage_banner <<~EOS `update-test` []: - Runs a test of `brew update` with a new repository clone. - + Run a test of `brew update` with a new repository clone. If no arguments are passed, use `origin/master` as the start commit. EOS switch "--to-tag", diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index b31f557bf2..fceb87b5b0 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -8,7 +8,7 @@ describe "brew bottle", :integration_test do (HOMEBREW_CELLAR/"patchelf/1.0/bin").mkpath expect { brew "bottle", "--no-rebuild", testball } - .to output(/Formula not from core or any taps/).to_stderr + .to output(/Formula not from core or any installed taps/).to_stderr .and not_to_output.to_stdout .and be_a_failure