Add and apply Style/RedundantRegexpCharacterClass rubocop rule

This rule was introduced in RuboCop 0.93.0, but now after seeing a fix in version 1.65,
we have decided to add it. The reason for adding it is to simplify our regular
expressions. This enforcement will help us maintain better regular expression
practices across the project.
This commit is contained in:
taitus
2024-10-09 09:33:35 +02:00
parent 0b9aeedbcc
commit d94eed8628
2 changed files with 4 additions and 1 deletions

View File

@@ -781,6 +781,9 @@ Style/RedundantInterpolation:
Style/RedundantParentheses: Style/RedundantParentheses:
Enabled: true Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantReturn: Style/RedundantReturn:
Enabled: true Enabled: true

View File

@@ -39,7 +39,7 @@ class SignatureSheet < ApplicationRecord
end end
def parsed_required_fields_to_verify_groups def parsed_required_fields_to_verify_groups
required_fields_to_verify.split(/[;]/).map { |d| d.gsub(/\s+/, "") }.map { |group| group.split(/[,]/) } required_fields_to_verify.split(/;/).map { |d| d.gsub(/\s+/, "") }.map { |group| group.split(/,/) }
end end
def signable_found def signable_found