From 343f62e4555be0470326f47af219689e21c61a37 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sun, 19 Jul 2020 23:14:54 -0400 Subject: [PATCH] Source can only be valid utf-8, so `scrub` is useless there See https://github.com/whitequark/parser/#invalid-characters-inside-comments-and-literals --- lib/rubocop/cop/layout/heredoc_indentation.rb | 4 ++-- lib/rubocop/cop/lint/interpolation_check.rb | 2 +- lib/rubocop/cop/style/percent_literal_delimiters.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rubocop/cop/layout/heredoc_indentation.rb b/lib/rubocop/cop/layout/heredoc_indentation.rb index e2c617567ac..8f1bb8d9568 100644 --- a/lib/rubocop/cop/layout/heredoc_indentation.rb +++ b/lib/rubocop/cop/layout/heredoc_indentation.rb @@ -161,11 +161,11 @@ def indentation_width end def heredoc_body(node) - node.loc.heredoc_body.source.scrub + node.loc.heredoc_body.source end def heredoc_end(node) - node.loc.heredoc_end.source.scrub + node.loc.heredoc_end.source end end end diff --git a/lib/rubocop/cop/lint/interpolation_check.rb b/lib/rubocop/cop/lint/interpolation_check.rb index 766677ced48..5418402e341 100644 --- a/lib/rubocop/cop/lint/interpolation_check.rb +++ b/lib/rubocop/cop/lint/interpolation_check.rb @@ -23,7 +23,7 @@ class InterpolationCheck < Cop def on_str(node) parent = node.parent return if parent && (parent.dstr_type? || parent.regexp_type?) - return unless /(?