Sha256: afaae6e3631c8c491dc9a919f4206417950ae8c015fb9868d88c087eeb2df1b3
Contents?: true
Size: 487 Bytes
Versions: 18
Compression:
Stored size: 487 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop class NumericLiterals < Cop ERROR_MESSAGE = 'Add underscores to large numeric literals to ' + 'improve their readability.' def inspect(file, source, tokens, sexp) tokens.each do |t| if [:on_int, :on_float].include?(t.type) && t.text.split('.').grep(/\d{6}/).any? add_offence(:convention, t.pos.lineno, ERROR_MESSAGE) end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems