Explorar el Código

have linter check the link text even if it doesn't contain ->

Ruduki2 hace 6 años
padre
commit
6b48a32450
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      Rakefile

+ 2 - 3
Rakefile

@@ -90,14 +90,14 @@ task :lint do
         case link.scan('->').length
         when 0
           #puts("link contains no ->, probably not a problem")
-          next
+          text = link
         when 1
           # no problem
+          text, dest = link.split('->')
         else
           puts("link contains multiple -> definitely a problem")
           next
         end
-        text, dest = link.split('->')
         if text.start_with?('\'')
           if !text.end_with?('\'')
             puts("#{filename}:#{lineno} link text (#{text.inspect}) does not end with single quote despite starting with one")
@@ -129,7 +129,6 @@ task :lint do
         elsif text =~ /\A[\[\]'"\\]*\Z/
           puts "#{filename}:#{lineno} link text (#{text.inspect}) contains special characters but is not quoted with single or double quotes"
         end
-        #puts(dest)
       end
     end
   end