Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete references to devel #10196

Merged
merged 3 commits into from Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions Library/Homebrew/cli/args.rbi
Expand Up @@ -3,9 +3,6 @@
module Homebrew
module CLI
class Args < OpenStruct
sig { returns(T.nilable(T::Boolean)) }
def devel?; end

sig { returns(T.nilable(T::Boolean)) }
def HEAD?; end

Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/cmd/fetch.rb
Expand Up @@ -24,8 +24,6 @@ def fetch_args
EOS
switch "--HEAD",
description: "Fetch HEAD version instead of stable version."
switch "--devel",
description: "Fetch development version instead of stable version."
switch "-f", "--force",
description: "Remove a previously cached version and re-fetch."
switch "-v", "--verbose",
Expand Down Expand Up @@ -53,10 +51,8 @@ def fetch_args
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"

conflicts "--devel", "--HEAD"
conflicts "--build-from-source", "--build-bottle", "--force-bottle"
conflicts "--cask", "--HEAD"
conflicts "--cask", "--devel"
conflicts "--cask", "--deps"
conflicts "--cask", "-s"
conflicts "--cask", "--build-bottle"
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/dev-cmd/test.rb
Expand Up @@ -23,16 +23,13 @@ def test_args

*Example:* `brew install jruby && brew test jruby`
EOS
switch "--devel",
description: "Test the development version of a formula."
switch "--HEAD",
description: "Test the head version of a formula."
switch "--keep-tmp",
description: "Retain the temporary files created for the test."
switch "--retry",
description: "Retry if a testing fails."

conflicts "--devel", "--HEAD"
min_named :formula
end
end
Expand Down
5 changes: 2 additions & 3 deletions Library/Homebrew/rubocops/lines.rb
Expand Up @@ -473,10 +473,9 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end

find_instance_method_call(body_node, "ARGV", :include?) do |method|
param = parameters(method).first
next unless match = regex_match_group(param, /^--(HEAD|devel)/)
next unless parameters_passed?(method, "--HEAD")

problem "Use \"if build.#{match[1].downcase}?\" instead"
problem "Use \"if build.head?\" instead"
Comment on lines -476 to +478
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke a style test. Instead, just remove the --devel sections. You can reproduce with brew tests --only=rubocops/lines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think that the new check is better. Before, the problematic node was just the "HEAD" string. Now, it's the whole ARGV.include? "HEAD" method. In practice, a user will replace the entire method with build.with? "HEAD" rather than just the string "HEAD", so I think this way makes more sense.

The test itself still needs to be updated, though.

end

find_const(body_node, "MACOS_VERSION") do
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/rubocops/lines_spec.rb
Expand Up @@ -1387,8 +1387,8 @@ class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
test do
head = ARGV.include? "--HEAD"
^^^^^^ Use "if build.head?" instead
^^^^ Use build instead of ARGV to check options
^^^^^^^^^^^^^^^^^^^^^^ Use "if build.head?" instead
end
end
RUBY
Expand Down
32 changes: 4 additions & 28 deletions Library/Homebrew/test/rubocops/urls_spec.rb
Expand Up @@ -211,18 +211,18 @@ class Foo < Formula
end
end

it "with offenses in stable/devel/head block" do
it "with offenses in stable/head block" do
expect_offense(<<~RUBY)
class Foo < Formula
desc "foo"
url "https://foo.com"

devel do
stable do
url "git://github.com/foo.git",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please use https:// for git://github.com/foo.git
:tag => "v1.0.0-alpha.1",
:tag => "v1.0.1",
:revision => "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
version "1.0.0-alpha.1"
version "1.0.1"
end
end
RUBY
Expand Down Expand Up @@ -380,18 +380,6 @@ class Foo < Formula
RUBY
end

it "reports no offenses with missing arguments in `devel`" do
expect_no_offenses(<<~RUBY, "/homebrew-core/")
class Foo < Formula
desc "foo"
url "https://foo.com"
devel do
url "https://github.com/foo/bar.git"
end
end
RUBY
end

it "reports no offenses for non-core taps" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
Expand Down Expand Up @@ -477,18 +465,6 @@ class Foo < Formula
RUBY
end

it "reports no offenses with missing arguments in `devel`" do
expect_no_offenses(<<~RUBY, "/homebrew-core/")
class Foo < Formula
desc "foo"
url "https://foo.com"
devel do
url "https://github.com/foo/bar.git"
end
end
RUBY
end

it "reports no offenses for non-core taps" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/test/support/fixtures/receipt.json
Expand Up @@ -31,7 +31,6 @@
"spec": "stable",
"versions": {
"stable": "2.14",
"devel": "2.15",
"head": "HEAD-0000000"
}
}
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/version_spec.rb
Expand Up @@ -615,7 +615,7 @@
.to be_detected_from("https://brew.sh/dada-v2017-04-17.tar.gz")
end

specify "devel spec version style" do
specify "unstable version style" do
expect(described_class.create("1.3.0-beta.1"))
.to be_detected_from("https://registry.npmjs.org/@angular/cli/-/cli-1.3.0-beta.1.tgz")
expect(described_class.create("2.074.0-beta1"))
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/version.rb
Expand Up @@ -412,7 +412,6 @@ def self._parse(spec, detected_from_url:)
m = /[-_](\d+\.\d+(?:\.\d+)?(?:-\d+)?)[-_.](?:i[36]86|x86|x64(?:[-_](?:32|64))?)$/.match(stem)
return m.captures.first unless m.nil?

# devel spec
# e.g. https://registry.npmjs.org/@angular/cli/-/cli-1.3.0-beta.1.tgz
# e.g. https://github.com/dlang/dmd/archive/v2.074.0-beta1.tar.gz
# e.g. https://github.com/dlang/dmd/archive/v2.074.0-rc1.tar.gz
Expand Down
7 changes: 3 additions & 4 deletions completions/bash/brew
Expand Up @@ -227,7 +227,7 @@ _brew_fetch() {
-*)
__brewcomp "
--deps --force
--devel --HEAD
--HEAD
--build-from-source --force-bottle --build-bottle
--retry
$(brew options --compact "$prv" 2>/dev/null)
Expand Down Expand Up @@ -268,12 +268,11 @@ _brew_install() {
-*)
if __brewcomp_words_include "--interactive"
then
__brewcomp "--devel --git --HEAD"
__brewcomp "--git --HEAD"
else
__brewcomp "
--build-from-source --build-bottle --force-bottle
--debug
--devel
--HEAD
--ignore-dependencies
--interactive
Expand Down Expand Up @@ -604,7 +603,7 @@ _brew_uses() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
-*)
__brewcomp "--installed --recursive --include-build --include-test --include-optional --skip-recommended --devel --HEAD"
__brewcomp "--installed --recursive --include-build --include-test --include-optional --skip-recommended"
return
;;
esac
Expand Down
16 changes: 3 additions & 13 deletions completions/fish/brew.fish
Expand Up @@ -322,9 +322,7 @@ __fish_brew_complete_arg 'fetch' -l deps -d "Also download dependen
__fish_brew_complete_arg 'fetch' -l build-from-source -d "Fetch source package instead of bottle"
__fish_brew_complete_arg 'fetch' -s v -l verbose -d "Do a verbose VCS checkout"
__fish_brew_complete_arg 'fetch' -l retry -d "Retry if a download fails or re-download if the checksum has changed"
# --HEAD and --devel are mutually exclusive:
__fish_brew_complete_arg 'fetch; and not __fish_brew_opt --devel --HEAD' -l devel -d "Download the development version from a VCS"
__fish_brew_complete_arg 'fetch; and not __fish_brew_opt --devel --HEAD' -l HEAD -d "Download the HEAD version from a VCS"
__fish_brew_complete_arg 'fetch' -l HEAD -d "Download the HEAD version from a VCS"
# --build-from-source and --force-bottle are mutually exclusive:
__fish_brew_complete_arg 'fetch; and not __fish_brew_opt --force-bottle' -s s -l build-from-source -d "Download the source rather than a bottle"
__fish_brew_complete_arg 'fetch; and not __fish_brew_opt --build-from-source -s' -l force-bottle -d "Download a bottle if it exists"
Expand Down Expand Up @@ -386,9 +384,7 @@ __fish_brew_complete_arg 'install upgrade' -l cc -d "Attempt to compile using th
__fish_brew_complete_arg 'install upgrade; and not __fish_brew_opt --force-bottle' -s s -l build-from-source -d "Compile the formula from source"
# FIXME: -s misbehaves allowing --force-bottle
__fish_brew_complete_arg 'install upgrade; and not __fish_brew_opt -s --build-from-source' -l force-bottle -d "Install from a bottle if it exists"
# --HEAD and --devel are mutually exclusive:
__fish_brew_complete_arg 'install upgrade; and not __fish_brew_opt --devel --HEAD' -l devel -d "Install the development version"
__fish_brew_complete_arg 'install upgrade; and not __fish_brew_opt --devel --HEAD' -l HEAD -d "Install the HEAD version"
__fish_brew_complete_arg 'install upgrade' -l HEAD -d "Install the HEAD version"
__fish_brew_complete_arg 'install upgrade' -l keep-tmp -d "Keep temp files created during installation"
__fish_brew_complete_arg 'install upgrade' -l build-bottle -d "Prepare the formula for eventual bottling during installation"
__fish_brew_complete_arg 'install upgrade' -s i -l interactive -d "Download and patch formula, then open a shell"
Expand Down Expand Up @@ -596,9 +592,6 @@ __fish_brew_complete_arg 'uses' -l recursive -d "Resolve more than one level of
__fish_brew_complete_arg 'uses' -l include-build -d "Include the :build type dependencies"
__fish_brew_complete_arg 'uses' -l include-optional -d "Include the :optional type dependencies"
__fish_brew_complete_arg 'uses' -l skip-recommended -d "Skip :recommended type dependencies"
# --HEAD and --devel are mutually exclusive:
__fish_brew_complete_arg 'uses; and not __fish_brew_opt --devel --HEAD' -l devel -d "Find cases development builds using formulae"
__fish_brew_complete_arg 'uses; and not __fish_brew_opt --devel --HEAD' -l HEAD -d "Find cases HEAD builds using formulae"


__fish_brew_complete_cmd '--cache' "Display Homebrew/formula's cache location"
Expand Down Expand Up @@ -666,7 +659,6 @@ __fish_brew_complete_arg 'bottle; and __fish_brew_opt --write' -l no-commit -d "
__fish_brew_complete_cmd 'bump-formula-pr' "Create a pull request to update formula with a new URL or tag"
# FIXME: should it suggest all/installed formulae or only files with a cetain name?
__fish_brew_complete_arg 'bump-formula-pr' -a '(__fish_brew_suggest_formulae_all)'
__fish_brew_complete_arg 'bump-formula-pr' -l devel -d "Bump the development version instead of stable"
__fish_brew_complete_arg 'bump-formula-pr' -s n -l dry-run -d "Show what would be done"
# --write depends on --dry-run:
__fish_brew_complete_arg 'bump-formula-pr; and __fish_brew_opt -n --dry-run' -l write -d "Write changes but not commit them"
Expand Down Expand Up @@ -742,9 +734,7 @@ __fish_brew_complete_cmd 'test' "Run tests for given formula"
__fish_brew_complete_arg 'test' -a '(__fish_brew_suggest_formulae_installed)'
__fish_brew_complete_arg 'test' -s d -l debug -d "Test with an interative debugger"
__fish_brew_complete_arg 'test' -l keep-tmp -d "Don't delete temp files created for the test"
# --HEAD and --devel are mutually exclusive:
__fish_brew_complete_arg 'test; and not __fish_brew_opt --devel --HEAD' -l devel -d "Test the development version"
__fish_brew_complete_arg 'test; and not __fish_brew_opt --devel --HEAD' -l HEAD -d "Test the HEAD version"
__fish_brew_complete_arg 'test' -l HEAD -d "Test the HEAD version"


__fish_brew_complete_cmd 'tests' "Run Homebrew's unit and integration tests"
Expand Down
23 changes: 10 additions & 13 deletions completions/zsh/_brew
Expand Up @@ -248,11 +248,10 @@ _brew_bottle() {
'--write'
}

# brew bump-formula-pr [--devel] [--dry-run] [--audit|--strict] --url=url --sha256=sha-256 formula
# brew bump-formula-pr [--devel] [--dry-run] [--audit|--strict] --tag=tag --revision=revision formula
# brew bump-formula-pr [--dry-run] [--audit|--strict] --url=url --sha256=sha-256 formula
# brew bump-formula-pr [--dry-run] [--audit|--strict] --tag=tag --revision=revision formula
_brew_bump_formula_pr() {
_arguments \
'--devel[bump the development rather than stable version]' \
'--dry-run[print what would be done rather than doing it]' \
'(--strict)--audit[run brew audit before opening the PR]' \
'(--audit)--strict[run brew audit --strict before opening the PR]' \
Expand Down Expand Up @@ -385,15 +384,14 @@ _brew_edit() {
'*:: :__brew_formulae_or_ruby_files'
}

# brew fetch [--force] [--retry] [-v] [--devel|--HEAD] [--deps]
# brew fetch [--force] [--retry] [-v] [--HEAD] [--deps]
# [--build-from-source|--build-bottle|--force-bottle] formulae
_brew_fetch() {
_arguments \
'(--force -f)'{--force,-f}'[remove previously cached version and re-fetch]' \
'--retry[retry if a download fails or re-download if the checksum of a previously cached version no longer matches]' \
'(--verbose -v)'{--verbose,-v}'[verbose VCS checkout]' \
'(--HEAD)--devel[fetch devel version instead of stable]' \
'(--devel)--HEAD[fetch HEAD version instead of stable]' \
'--HEAD[fetch HEAD version instead of stable]' \
'--deps[also download dependencies for any listed formulae]' \
'(--build-from-source -s --force-bottle --build-bottle)'{--build-from-source,-s}'[download the source rather than a bottle]' \
'(--build-from-source -s --force-bottle)--build-bottle[download the source (for eventual bottling) rather than a bottle]' \
Expand Down Expand Up @@ -444,7 +442,7 @@ _brew_info() {
# brew install [--debug] [--env=std|super]
# [--ignore-dependencies|--only-dependencies] [--include-test]
# [--cc=compiler] [--build-from-source|--build-bottle|--force-fottle]
# [--devel|--HEAD] [--fetch-HEAD] [--bottle-arch=architecture] [--keep-tmp] formulae
# [--HEAD] [--fetch-HEAD] [--bottle-arch=architecture] [--keep-tmp] formulae
# brew install --interactive [--git] formula
_brew_install() {
local state
Expand All @@ -459,7 +457,7 @@ _brew_install() {
'(--build-from-source -s --force-bottle)--build-bottle[prepare the formula for eventual bottling during installation, skipping any post-install steps]' \
'(--build-from-source -s --build-bottle)--force-bottle[install from a bottle if it exists for the current version of OS X, even if it would not normally be used for installation]' \
'--include-test[install testing dependencies]' \
'(--devel --HEAD)'{--devel,--HEAD}'[install the development / HEAD version]' \
'--HEAD[install the HEAD version]' \
'--fetch-HEAD[fetch the upstream repository to detect if the HEAD installation of the formula is outdated]' \
'--bottle-arch=-[optimise bottles for the specified architecture]:architecture: ' \
'--keep-tmp[don''t delete temporary files created during installation]' \
Expand Down Expand Up @@ -723,10 +721,10 @@ _brew_tap_readme() {
':name: '
}

# brew test [--devel|--HEAD] [--debug] [--keep-tmp] formulae:
# brew test [--HEAD] [--debug] [--keep-tmp] formulae:
_brew_test() {
_arguments \
'(--devel --HEAD)'{--devel,--HEAD}'[use the development / head version of the formula]' \
'--HEAD[use the head version of the formula]' \
'--debug[launch an interactive debugger if test fails]' \
'--keep-tmp[don''t delete temporary files]' \
'*:formula:__brew_formulae_or_ruby_files'
Expand Down Expand Up @@ -838,7 +836,7 @@ _brew_upgrade() {
'--cc=-[attempt to compile using compiler]:compiler: ' \
'(--build-from-source -s --force-bottle)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \
'(--build-from-source -s)--force-bottle[install from a bottle if it exists for the current version of OS X, even if it would not normally be used for installation]' \
'(--devel --HEAD)'{--devel,--HEAD}'[install the development / HEAD version]' \
'--HEAD[install the HEAD version]' \
'--keep-tmp[don''t delete temporary files created during installation]' \
'--display-times[display installation times at end of run]' \
'*: : __brew_outdated_formulae' \
Expand All @@ -850,15 +848,14 @@ _brew_upgrade() {
}

# brew uses [--installed] [--recursive] [--include-build] [--include-optional]
# [--skip-recommended] [--devel|--HEAD] formulae:
# [--skip-recommended] formulae:
_brew_uses() {
_arguments \
'--installed[only list installed formulae]' \
'--recursive[resolve more than one level of dependencies]' \
'--include-build[include the :build type dependencies]' \
'--include-optional[include the :optional dependencies]' \
'--skip-recommended[skip :recommended type dependencies]' \
'(--devel --HEAD)'{--devel,--HEAD}'[find cases where formula is used by development / HEAD build]' \
'*:formula:__brew_formulae'
}

Expand Down
4 changes: 0 additions & 4 deletions docs/Manpage.md
Expand Up @@ -167,8 +167,6 @@ and binaries for *`cask`*s. For files, also print SHA-256 checksums.

* `--HEAD`:
Fetch HEAD version instead of stable version.
* `--devel`:
Fetch development version instead of stable version.
* `-f`, `--force`:
Remove a previously cached version and re-fetch.
* `-v`, `--verbose`:
Expand Down Expand Up @@ -1277,8 +1275,6 @@ user if something is wrong with the installed formula.

*Example:* `brew install jruby && brew test jruby`

* `--devel`:
Test the development version of a formula.
* `--HEAD`:
Test the head version of a formula.
* `--keep-tmp`:
Expand Down
8 changes: 0 additions & 8 deletions manpages/brew.1
Expand Up @@ -194,10 +194,6 @@ Download a bottle (if available) or source packages for \fIformula\fRe and binar
Fetch HEAD version instead of stable version\.
.
.TP
\fB\-\-devel\fR
Fetch development version instead of stable version\.
.
.TP
\fB\-f\fR, \fB\-\-force\fR
Remove a previously cached version and re\-fetch\.
.
Expand Down Expand Up @@ -1768,10 +1764,6 @@ Run the test method provided by an installed formula\. There is no standard outp
\fIExample:\fR \fBbrew install jruby && brew test jruby\fR
.
.TP
\fB\-\-devel\fR
Test the development version of a formula\.
.
.TP
\fB\-\-HEAD\fR
Test the head version of a formula\.
.
Expand Down