lib/rubocop/cop/rbs/layout/trailing_whitespace.rb in rubocop-on-rbs-0.8.0 vs lib/rubocop/cop/rbs/layout/trailing_whitespace.rb in rubocop-on-rbs-0.9.0
- old
+ new
@@ -20,16 +20,16 @@
MSG = "Trailing whitespace detected."
def on_rbs_new_investigation
total = 0
processed_source.raw_source.each_line do |line|
- total += line.bytesize
+ total += line.length
chomped = line.chomp
next unless chomped.end_with?(' ', "\t")
range = range_between(
- total - line.bytesize + chomped.rstrip.bytesize,
- total - line.bytesize + chomped.bytesize,
+ total - line.length + chomped.rstrip.length,
+ total - line.length + chomped.length,
)
add_offense(range) do |corrector|
corrector.remove(range)
end
end