Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
01161074
Commit
01161074
authored
Jul 28, 2017
by
Dave Machado
Browse files
pop main logic out one level by reversing condition
parent
8c74f6fe
Changes
1
Show whitespace changes
Inline
Side-by-side
build/validate_format.rb
View file @
01161074
...
@@ -31,9 +31,9 @@ end
...
@@ -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 |
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment