mirror of
https://github.com/public-apis/public-apis.git
synced 2025-06-09 14:21:49 +02:00
pop main logic out one level by reversing condition
This commit is contained in:
parent
8c74f6fe68
commit
01161074fa
1 changed files with 43 additions and 44 deletions
|
@ -31,9 +31,9 @@ end
|
||||||
|
|
||||||
File.foreach(filename).with_index do | line, line_num |
|
File.foreach(filename).with_index do | line, line_num |
|
||||||
line_num += 1
|
line_num += 1
|
||||||
if line.start_with?('|')
|
|
||||||
# Skip table schema lines
|
# Skip non-markdown table lines and table schema lines
|
||||||
if line.eql? "|---|---|---|---|---|\n"
|
if !line.start_with?('|') || line.eql?("|---|---|---|---|---|\n")
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -79,7 +79,6 @@ File.foreach(filename).with_index do | line, line_num |
|
||||||
if !link_val.start_with?("[Go!](") || !link_val.end_with?(')')
|
if !link_val.start_with?("[Go!](") || !link_val.end_with?(')')
|
||||||
add_error(line_num, INDEX_LINK, "format should be \"[Go!](<LINK>)\": #{link_val}")
|
add_error(line_num, INDEX_LINK, "format should be \"[Go!](<LINK>)\": #{link_val}")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
$errors.each do | e |
|
$errors.each do | e |
|
||||||
puts e
|
puts e
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue