mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocop: remove NewFormulaAudit.
This is no longer used anywhere.
This commit is contained in:
parent
44c22dd7e3
commit
d52e870b07
@ -8,10 +8,6 @@ FormulaAudit:
|
|||||||
FormulaAuditStrict:
|
FormulaAuditStrict:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# disable all formulae strict audits by default
|
|
||||||
NewFormulaAudit:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
# make our hashes consistent
|
# make our hashes consistent
|
||||||
Layout/HashAlignment:
|
Layout/HashAlignment:
|
||||||
EnforcedHashRocketStyle: table
|
EnforcedHashRocketStyle: table
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
inherit_from: ./.rubocop.yml
|
|
||||||
|
|
||||||
NewFormulaAudit:
|
|
||||||
Enabled: true
|
|
@ -8,9 +8,6 @@ AllCops:
|
|||||||
Exclude:
|
Exclude:
|
||||||
- '**/vendor/**/*'
|
- '**/vendor/**/*'
|
||||||
|
|
||||||
NewFormulaAudit:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# Intentionally disabled as it doesn't fit with our code style.
|
# Intentionally disabled as it doesn't fit with our code style.
|
||||||
RSpec/AnyInstance:
|
RSpec/AnyInstance:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -58,8 +58,7 @@ module Homebrew
|
|||||||
options[:except_cops] = except_cops
|
options[:except_cops] = except_cops
|
||||||
elsif only_cops.nil? && except_cops.nil?
|
elsif only_cops.nil? && except_cops.nil?
|
||||||
options[:except_cops] = %w[FormulaAudit
|
options[:except_cops] = %w[FormulaAudit
|
||||||
FormulaAuditStrict
|
FormulaAuditStrict]
|
||||||
NewFormulaAudit]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Homebrew.failed = !Style.check_style_and_print(target, options)
|
Homebrew.failed = !Style.check_style_and_print(target, options)
|
||||||
|
@ -95,8 +95,6 @@ module Homebrew
|
|||||||
options[:only_cops] = only_cops
|
options[:only_cops] = only_cops
|
||||||
elsif args.new_formula?
|
elsif args.new_formula?
|
||||||
nil
|
nil
|
||||||
elsif strict
|
|
||||||
options[:except_cops] = [:NewFormulaAudit]
|
|
||||||
elsif except_cops
|
elsif except_cops
|
||||||
options[:except_cops] = except_cops
|
options[:except_cops] = except_cops
|
||||||
elsif !strict
|
elsif !strict
|
||||||
@ -231,12 +229,6 @@ module Homebrew
|
|||||||
return unless @style_offenses
|
return unless @style_offenses
|
||||||
|
|
||||||
@style_offenses.each do |offense|
|
@style_offenses.each do |offense|
|
||||||
if offense.cop_name.start_with?("NewFormulaAudit")
|
|
||||||
next if @versioned_formula
|
|
||||||
|
|
||||||
new_formula_problem offense.to_s(display_cop_name: @display_cop_names)
|
|
||||||
next
|
|
||||||
end
|
|
||||||
problem offense.to_s(display_cop_name: @display_cop_names)
|
problem offense.to_s(display_cop_name: @display_cop_names)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -46,12 +46,5 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Keep this (empty) module and class around in case we need it later to
|
|
||||||
# avoid deleting all the NewFormulaAudit referencing logic.
|
|
||||||
module NewFormulaAudit
|
|
||||||
class Options < FormulaCop
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -60,7 +60,7 @@ module Homebrew
|
|||||||
config = if files.first && File.exist?("#{files.first}/spec")
|
config = if files.first && File.exist?("#{files.first}/spec")
|
||||||
HOMEBREW_LIBRARY/".rubocop_rspec.yml"
|
HOMEBREW_LIBRARY/".rubocop_rspec.yml"
|
||||||
else
|
else
|
||||||
HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
HOMEBREW_LIBRARY/".rubocop.yml"
|
||||||
end
|
end
|
||||||
args << "--config" << config
|
args << "--config" << config
|
||||||
end
|
end
|
||||||
|
@ -10,13 +10,13 @@ end
|
|||||||
describe "brew style" do
|
describe "brew style" do
|
||||||
around do |example|
|
around do |example|
|
||||||
FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew"
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew"
|
||||||
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop.yml"
|
||||||
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop_shared.yml", HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop_shared.yml", HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
||||||
|
|
||||||
example.run
|
example.run
|
||||||
ensure
|
ensure
|
||||||
FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew"
|
FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew"
|
||||||
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop.yml"
|
||||||
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ describe "brew style" do
|
|||||||
EOS
|
EOS
|
||||||
rubocop_result = Homebrew::Style.check_style_json(
|
rubocop_result = Homebrew::Style.check_style_json(
|
||||||
[formula],
|
[formula],
|
||||||
fix: true, only_cops: ["NewFormulaAudit/DependencyOrder"],
|
fix: true, only_cops: ["FormulaAudit/DependencyOrder"],
|
||||||
)
|
)
|
||||||
offense_string = rubocop_result.file_offenses(formula.realpath).first.to_s
|
offense_string = rubocop_result.file_offenses(formula.realpath).first.to_s
|
||||||
expect(offense_string).to match(/\[Corrected\]/)
|
expect(offense_string).to match(/\[Corrected\]/)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user