Sha256: 3b0d13ed59f129baf6883f9866a2e5d03abb26a2a4a4c0a9ff7190f12f37ae07
Contents?: true
Size: 551 Bytes
Versions: 11
Compression:
Stored size: 551 Bytes
Contents
# encoding: utf-8 # frozen_string_literal: true module RuboCop module Cop # Common functionality for handling parentheses. module Parentheses def parens_required?(node) range = node.source_range source = range.source_buffer.source source[range.begin_pos - 1] =~ /[a-z]/ || source[range.end_pos] =~ /[a-z]/ end def autocorrect(node) lambda do |corrector| corrector.remove(node.loc.begin) corrector.remove(node.loc.end) end end end end end
Version data entries
11 entries across 11 versions & 2 rubygems