]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Style/WhileUntilModifier in lib/redmine/wiki_formatting...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 07:26:59 +0000 (07:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 07:26:59 +0000 (07:26 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18738 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
lib/redmine/wiki_formatting/textile/redcloth3.rb

index 76389e5635f4af31722eb7e6a3ebb53accaad123..0da5b7de14ae715105f39f43bdb1d653ecb5bdd5 100644 (file)
@@ -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.
index 5d7ac768bed81094c7e008c42f617e0d1c91bff8..750bf8cacbb2c1db3b01fc07c6713ae9c33b21f3 100644 (file)
@@ -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