Skip to content

Commit 67cfacf

Browse files
davidanthoffgithub-actions[bot]
authored andcommitted
Format files using DocumentFormat
1 parent 4edea2c commit 67cfacf

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/packagedef.jl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
55
child_nodes = children(node)
66

77
# Check for various syntax errors
8-
if length(child_nodes)==1
8+
if length(child_nodes) == 1
99
push!(testerrors, (message="Your @testitem is missing a name and code block.", range=testitem_range))
1010
return
11-
elseif length(child_nodes)>1 && !(kind(child_nodes[2]) == K"string")
11+
elseif length(child_nodes) > 1 && !(kind(child_nodes[2]) == K"string")
1212
push!(testerrors, (message="Your @testitem must have a first argument that is of type String for the name.", range=testitem_range))
1313
return
14-
elseif length(child_nodes)==2
14+
elseif length(child_nodes) == 2
1515
push!(testerrors, (message="Your @testitem is missing a code block argument.", range=testitem_range))
1616
return
1717
elseif !(kind(child_nodes[end]) == K"block")
@@ -27,10 +27,10 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
2727
if kind(i) != K"="
2828
push!(testerrors, (message="The arguments to a @testitem must be in keyword format.", range=testitem_range))
2929
return
30-
elseif !(length(children(i))==2)
30+
elseif !(length(children(i)) == 2)
3131
error("This code path should not be possible.")
3232
elseif kind(i[1]) == K"Identifier" && i[1].val == :tags
33-
if option_tags!==nothing
33+
if option_tags !== nothing
3434
push!(testerrors, (message="The keyword argument tags cannot be specified more than once.", range=testitem_range))
3535
return
3636
end
@@ -63,7 +63,7 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
6363

6464
option_default_imports = i[2].val
6565
elseif kind(i[1]) == K"Identifier" && i[1].val == :setup
66-
if option_setup!==nothing
66+
if option_setup !== nothing
6767
push!(testerrors, (message="The keyword argument setup cannot be specified more than once.", range=testitem_range))
6868
return
6969
end
@@ -89,15 +89,15 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
8989
end
9090
end
9191

92-
if option_tags===nothing
92+
if option_tags === nothing
9393
option_tags = Symbol[]
9494
end
9595

96-
if option_default_imports===nothing
96+
if option_default_imports === nothing
9797
option_default_imports = true
9898
end
9999

100-
if option_setup===nothing
100+
if option_setup === nothing
101101
option_setup = Symbol[]
102102
end
103103

@@ -109,8 +109,8 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
109109
end
110110

111111
push!(testitems,
112-
(
113-
name=node[2,1].val,
112+
(
113+
name=node[2, 1].val,
114114
range=testitem_range,
115115
code_range=code_range,
116116
option_default_imports=option_default_imports,
@@ -127,13 +127,13 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
127127
child_nodes = children(node)
128128

129129
# Check for various syntax errors
130-
if length(child_nodes)==1
130+
if length(child_nodes) == 1
131131
push!(testerrors, (message="Your $testkind is missing a name and code block.", range=testitem_range))
132132
return
133-
elseif length(child_nodes)>1 && !(kind(child_nodes[2]) == K"Identifier")
133+
elseif length(child_nodes) > 1 && !(kind(child_nodes[2]) == K"Identifier")
134134
push!(testerrors, (message="Your $testkind must have a first argument that is an identifier for the name.", range=testitem_range))
135135
return
136-
elseif length(child_nodes)==2
136+
elseif length(child_nodes) == 2
137137
push!(testerrors, (message="Your $testkind is missing a code block argument.", range=testitem_range))
138138
return
139139
elseif !(kind(child_nodes[end]) == K"block")
@@ -145,7 +145,7 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
145145
if kind(i) != K"="
146146
push!(testerrors, (message="The arguments to a $testkind must be in keyword format.", range=testitem_range))
147147
return
148-
elseif !(length(children(i))==2)
148+
elseif !(length(children(i)) == 2)
149149
error("This code path should not be possible.")
150150
else
151151
push!(testerrors, (message="Unknown keyword argument.", range=testitem_range))
@@ -161,9 +161,9 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
161161
(first(range(code_block))+5):(last(range(code_block))-3)
162162
end
163163

164-
testkind2 = if testkind==Symbol("@testmodule")
164+
testkind2 = if testkind == Symbol("@testmodule")
165165
:module
166-
elseif testkind==Symbol("@testsnippet")
166+
elseif testkind == Symbol("@testsnippet")
167167
:snippet
168168
else
169169
error("Unknown testkind")

0 commit comments

Comments
 (0)