Skip to content
Snippets Groups Projects
Commit 1e943d7b authored by Rylan Polster's avatar Rylan Polster
Browse files

style: env :std deprecated in homebrew-core

parent bd8805b1
No related branches found
No related tags found
No related merge requests found
......@@ -887,11 +887,6 @@ module Homebrew
# TODO: check could be in RuboCop
problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")"
end
return unless @core_tap
# TODO: check could be in RuboCop
problem "`env :std` in homebrew/core formulae is deprecated" if line.include?("env :std")
end
def audit_reverse_migration
......
......@@ -79,6 +79,12 @@ module RuboCop
find_method_with_args(body_node, :go_resource) do
problem "`go_resource`s are deprecated. Please ask upstream to implement Go vendoring"
end
return unless formula_tap == "homebrew-core"
find_method_with_args(body_node, :env, :std) do
problem "`env :std` in homebrew/core formulae is deprecated"
end
end
end
end
......
......@@ -21,7 +21,7 @@ RSpec/InstanceVariable:
- 'utils/git_spec.rb'
- 'version_spec.rb'
# Offense count: 74
# Offense count: 75
RSpec/MultipleDescribes:
Exclude:
- 'ENV_spec.rb'
......@@ -94,6 +94,7 @@ RSpec/MultipleDescribes:
- 'rubocops/class_spec.rb'
- 'rubocops/formula_desc_spec.rb'
- 'rubocops/lines_spec.rb'
- 'rubocops/text_spec.rb'
- 'rubocops/urls_spec.rb'
- 'software_spec_spec.rb'
- 'tap_spec.rb'
......
......@@ -228,3 +228,20 @@ describe RuboCop::Cop::FormulaAudit::Text do
end
end
end
describe RuboCop::Cop::FormulaAuditStrict::Text do
subject(:cop) { described_class.new }
context "When auditing formula text" do
it "when deprecated `env :std` is present in homebrew-core" do
expect_offense(<<~RUBY, "/homebrew-core/")
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
env :std
^^^^^^^^ `env :std` in homebrew/core formulae is deprecated
end
RUBY
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment