From 0564d2df7aaf6cc8e9c728c386c01c45e34085a5 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 7 Apr 2017 23:58:43 -0400 Subject: [PATCH] add performance/stringreplacement rubocop cop Enabled the performance/stringreplacement rubocop in the .rubocop.yml file and removed it from .rubocop_todo.yml. This cop checks for instances where gsub can be replaced with tr or delete. Supports auto correct, but there weren't any offenses. Closes #1444 --- .rubocop.yml | 8 +++++++- .rubocop_todo.yml | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 08bc0e68..c2e973f0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -104,7 +104,7 @@ Style/TrailingBlankLines: Style/TrailingWhitespace: Enabled: true -#This cop checks for numeric comparisons that can be replaced by a predicate method. +# This cop checks for numeric comparisons that can be replaced by a predicate method. Style/ZeroLengthPredicate: Enabled: true @@ -183,3 +183,9 @@ Rails: # Avoid use of old-style attribute validation Rails/Validation: Enabled: true + +#################### Performance ############################### + +# Identifies places where gsub can be replaced by tr or delete. +Performance/StringReplacement: + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 18fd7930..330eb3cd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -48,12 +48,6 @@ Metrics/ModuleLength: Metrics/PerceivedComplexity: Max: 15 -# Offense count: 1 -# Cop supports --auto-correct. -Performance/StringReplacement: - Exclude: - - 'spec/support/save_feature_failures.rb' - # Offense count: 13 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, Include.