diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 2d7767db2d..216b443b0b 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -8,10 +8,6 @@ FormulaAudit: FormulaAuditStrict: Enabled: true -# disable all formulae strict audits by default -NewFormulaAudit: - Enabled: false - # make our hashes consistent Layout/HashAlignment: EnforcedHashRocketStyle: table diff --git a/Library/.rubocop_audit.yml b/Library/.rubocop_audit.yml deleted file mode 100644 index 80c224ca06..0000000000 --- a/Library/.rubocop_audit.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: ./.rubocop.yml - -NewFormulaAudit: - Enabled: true diff --git a/Library/.rubocop_rspec.yml b/Library/.rubocop_rspec.yml index c9fe520ac5..6699a39d4f 100644 --- a/Library/.rubocop_rspec.yml +++ b/Library/.rubocop_rspec.yml @@ -8,9 +8,6 @@ AllCops: Exclude: - '**/vendor/**/*' -NewFormulaAudit: - Enabled: true - # Intentionally disabled as it doesn't fit with our code style. RSpec/AnyInstance: Enabled: false diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 056eb4c87a..d9736a83b3 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -58,8 +58,7 @@ module Homebrew options[:except_cops] = except_cops elsif only_cops.nil? && except_cops.nil? options[:except_cops] = %w[FormulaAudit - FormulaAuditStrict - NewFormulaAudit] + FormulaAuditStrict] end Homebrew.failed = !Style.check_style_and_print(target, options) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index d8d3f6141e..1eb717569f 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -95,8 +95,6 @@ module Homebrew options[:only_cops] = only_cops elsif args.new_formula? nil - elsif strict - options[:except_cops] = [:NewFormulaAudit] elsif except_cops options[:except_cops] = except_cops elsif !strict @@ -231,12 +229,6 @@ module Homebrew return unless @style_offenses @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) end end diff --git a/Library/Homebrew/rubocops/options.rb b/Library/Homebrew/rubocops/options.rb index b3e0bc1a83..d5766145c6 100644 --- a/Library/Homebrew/rubocops/options.rb +++ b/Library/Homebrew/rubocops/options.rb @@ -46,12 +46,5 @@ module RuboCop 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 diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 879bcff02c..7285de1926 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -60,7 +60,7 @@ module Homebrew config = if files.first && File.exist?("#{files.first}/spec") HOMEBREW_LIBRARY/".rubocop_rspec.yml" else - HOMEBREW_LIBRARY/".rubocop_audit.yml" + HOMEBREW_LIBRARY/".rubocop.yml" end args << "--config" << config end diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb index 51d64d807f..60d6bf4966 100644 --- a/Library/Homebrew/test/cmd/style_spec.rb +++ b/Library/Homebrew/test/cmd/style_spec.rb @@ -10,13 +10,13 @@ end describe "brew style" do around do |example| 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" example.run ensure 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" end @@ -62,7 +62,7 @@ describe "brew style" do EOS rubocop_result = Homebrew::Style.check_style_json( [formula], - fix: true, only_cops: ["NewFormulaAudit/DependencyOrder"], + fix: true, only_cops: ["FormulaAudit/DependencyOrder"], ) offense_string = rubocop_result.file_offenses(formula.realpath).first.to_s expect(offense_string).to match(/\[Corrected\]/)