Sha256: 8e828b3ca1eebbdd34a6c4c9bfaf834cb8e59a41c6e27eaa618af1aac915ea03
Contents?: true
Size: 487 Bytes
Versions: 20
Compression:
Stored size: 487 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop # Common functionality for checking minimum body length. module MinBodyLength def min_body_length?(node) (node.loc.end.line - node.loc.keyword.line) > min_body_length end def min_body_length length = cop_config['MinBodyLength'] || 1 return length if length.is_a?(Integer) && length > 0 raise 'MinBodyLength needs to be a positive integer!' end end end end
Version data entries
20 entries across 20 versions & 2 rubygems