Skip to content
Snippets Groups Projects
Commit a4568a86 authored by Gautham Goli's avatar Gautham Goli
Browse files

Let cops run without --strict flag

parent 7a0e5d12
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@
require "utils"
require "json"
require "rubocop"
require_relative "../rubocops"
module Homebrew
module_function
......@@ -54,6 +56,10 @@ module Homebrew
]
args << "--auto-correct" if fix
if options[:only]
args << "--only" << RuboCop::Cop::Cop.registry.with_department(options[:only]).names.join(" ")
end
if files.nil?
args << "--config" << HOMEBREW_LIBRARY_PATH/".rubocop.yml"
args += [HOMEBREW_LIBRARY_PATH]
......
......@@ -75,9 +75,14 @@ module Homebrew
style_results = check_style_json(files, options)
end
if !strict
options = { fix: ARGV.flag?("--fix"), realpath: true, only: :Homebrew }
style_results = check_style_json(files, options)
end
ff.each do |f|
options = { new_formula: new_formula, strict: strict, online: online }
options[:style_offenses] = style_results.file_offenses(f.path) if strict
options[:style_offenses] = style_results.file_offenses(f.path)
fa = FormulaAuditor.new(f, options)
fa.audit
......
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