Class: Homebrew::DevCmd::StyleCmd

Inherits:
AbstractCommand show all
Defined in:
dev-cmd/style.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'dev-cmd/style.rb', line 45

def run
  target = if args.no_named?
    nil
  else
    args.named.to_paths
  end

  only_cops = args.only_cops
  except_cops = args.except_cops

  options = {
    fix:         args.fix?,
    reset_cache: args.reset_cache?,
    debug:       args.debug?,
    verbose:     args.verbose?,
  }
  if only_cops
    options[:only_cops] = only_cops
  elsif except_cops
    options[:except_cops] = except_cops
  else
    options[:except_cops] = %w[FormulaAuditStrict]
  end

  Homebrew.failed = !Style.check_style_and_print(target, **options)
end