class RuboCop::Cop::Style::BracesAroundHashParameters

def check_context_dependent(arg, args)

def check_context_dependent(arg, args)
  braces_around_second_from_end = args.size > 1 && args[-2].hash_type?
  if arg.braces?
    unless braces_around_second_from_end
      add_arg_offense(arg, :redundant)
    end
  elsif braces_around_second_from_end
    add_arg_offense(arg, :missing)
  end
end