global

def task(*)

def task(*)
  task = super
  if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
    non_namespaced_name = task.name.split(":").last
    description = non_namespaced_name
    description << task.arg_names.map { |n| n.to_s.upcase }.join(" ")
    description.strip!
    klass.desc description, Rake.application.last_description || non_namespaced_name
    Rake.application.last_description = nil
    klass.send :define_method, non_namespaced_name do |*args|
      Rake::Task[task.name.to_sym].invoke(*args)
    end
  end
  task
end