class RuboCop::Cop::Style::ColonMethodCall

of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).
This cop checks for methods invoked via the

operator instead

def allowed_name(method_name)

def allowed_name(method_name)
  method_name.match(/^[A-Z]/)
end

def autocorrect(node)

def autocorrect(node)
  @corrections << lambda do |corrector|
    corrector.replace(node.loc.dot, '.')
  end
end

def on_send(node)

def on_send(node)
  receiver, method_name, *_args = *node
  # discard methods with nil receivers and op methods(like [])
  return unless receiver && node.loc.dot && node.loc.dot.is?('::')
  return if allowed_name(method_name.to_s)
  add_offense(node, :dot)
end