From e3397db9330be3849444c64d9f65d96578468aeb Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 19 Oct 2019 07:26:59 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/WhileUntilModifier in lib/redmine/wiki_formatting/textile/redcloth3.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18738 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 1 - lib/redmine/wiki_formatting/textile/redcloth3.rb | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 76389e563..0da5b7de1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1453,7 +1453,6 @@ Style/WhileUntilModifier: - 'app/models/project.rb' - 'lib/redmine/unified_diff.rb' - 'lib/redmine/utils.rb' - - 'lib/redmine/wiki_formatting/textile/redcloth3.rb' # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinSize, WordRegex. diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index 5d7ac768b..750bf8cac 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -1022,9 +1022,9 @@ class RedCloth3 < String def flush_left( text ) indt = 0 if text =~ /^ / - while text !~ /^ {#{indt}}[^ ]/ - indt += 1 - end unless text.empty? + unless text.empty? + indt += 1 while text !~ /^ {#{indt}}[^ ]/ + end if indt.nonzero? text.gsub!( /^ {#{indt}}/, '' ) end -- 2.39.5