-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
For a multi-line string, I am using gsub(/^ /, '') and I receive a wrong suggestion that I should replace this call with delete_prefix.
Note that ^ matches at the beginning of a line, not only at the beginning of the string.
Expected behavior
No offense being reported.
Actual behavior
lib/colorls/flags.rb:169:23: C: Performance/DeletePrefix: Use delete_prefix instead of gsub.
puts <<EXAMPLES.gsub(/^ /, '')
^^^^
Steps to reproduce the problem
def show_examples
puts <<EXAMPLES.gsub(/^ /, '')
examples:
* show the given file:
colorls README.md
* show matching files and list matching directories:
EXAMPLES
end
RuboCop version
0.84.0 (using Parser 2.7.1.2, rubocop-ast 0.0.3, running on ruby 2.6.6 x86_64-linux)
mattbrictson
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working