From 9d3df08d677700f591bfd3bc6997a5faa5bd0064 Mon Sep 17 00:00:00 2001 From: Risako Date: Sat, 24 Jul 2021 13:12:42 +0900 Subject: [PATCH] [Fix #9150] Escape curly brackets in docs --- config/default.yml | 6 +++--- lib/rubocop/rspec/expect_offense.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/default.yml b/config/default.yml index 5fbba4556d7..c2615ec4c24 100644 --- a/config/default.yml +++ b/config/default.yml @@ -2532,7 +2532,7 @@ Naming/HeredocDelimiterNaming: Enabled: true VersionAdded: '0.50' ForbiddenDelimiters: - - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/' + - !ruby/regexp '/(^|\s)(EO[A-Z]\{1\}|END)(\s|$)/' Naming/InclusiveLanguage: Description: 'Recommend the use of inclusive language instead of problematic terms.' @@ -3210,7 +3210,7 @@ Style/Copyright: Description: 'Include a copyright notice in each file before any code.' Enabled: false VersionAdded: '0.30' - Notice: '^Copyright (\(c\) )?2[0-9]{3} .+' + Notice: '^Copyright (\(c\) )?2[0-9]\{3\} .+' AutocorrectNotice: '' Style/DateTime: @@ -4931,7 +4931,7 @@ Style/WordArray: # whose element count is greater than or equal to `MinSize`. MinSize: 2 # The regular expression `WordRegex` decides what is considered a word. - WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/' + WordRegex: !ruby/regexp '/\A(?:\p\{Word\}|\p\{Word\}-\p\{Word\}|\n|\t)+\z/' Style/YodaCondition: Description: 'Forbid or enforce yoda conditions.' diff --git a/lib/rubocop/rspec/expect_offense.rb b/lib/rubocop/rspec/expect_offense.rb index f4252262af0..bc3bdb862f9 100644 --- a/lib/rubocop/rspec/expect_offense.rb +++ b/lib/rubocop/rspec/expect_offense.rb @@ -72,8 +72,8 @@ module RSpec # # expect_no_corrections # - # If your code has variables of different lengths, you can use `%{foo}`, - # `^{foo}`, and `_{foo}` to format your template; you can also abbreviate + # If your code has variables of different lengths, you can use `%\{foo\}`, + # `^\{foo\}`, and `_\{foo\}` to format your template; you can also abbreviate # offense messages with `[...]`: # # %w[raise fail].each do |keyword|