Skip to content

Commit 59119a5

Browse files
davidanthoffgithub-actions[bot]
authored andcommitted
Format files using DocumentFormat
1 parent a176c01 commit 59119a5

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
@@ -10,13 +10,13 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
1010
child_nodes = children(node)
1111

1212
# Check for various syntax errors
13-
if length(child_nodes)==1
13+
if length(child_nodes) == 1
1414
push!(testerrors, (message="Your @testitem is missing a name and code block.", range=testitem_range))
1515
return
16-
elseif length(child_nodes)>1 && !(kind(child_nodes[2]) == K"string")
16+
elseif length(child_nodes) > 1 && !(kind(child_nodes[2]) == K"string")
1717
push!(testerrors, (message="Your @testitem must have a first argument that is of type String for the name.", range=testitem_range))
1818
return
19-
elseif length(child_nodes)==2
19+
elseif length(child_nodes) == 2
2020
push!(testerrors, (message="Your @testitem is missing a code block argument.", range=testitem_range))
2121
return
2222
elseif !(kind(child_nodes[end]) == K"block")
@@ -32,10 +32,10 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
3232
if kind(i) != K"="
3333
push!(testerrors, (message="The arguments to a @testitem must be in keyword format.", range=testitem_range))
3434
return
35-
elseif !(length(children(i))==2)
35+
elseif !(length(children(i)) == 2)
3636
error("This code path should not be possible.")
3737
elseif kind(i[1]) == K"Identifier" && i[1].val == :tags
38-
if option_tags!==nothing
38+
if option_tags !== nothing
3939
push!(testerrors, (message="The keyword argument tags cannot be specified more than once.", range=testitem_range))
4040
return
4141
end
@@ -68,7 +68,7 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
6868

6969
option_default_imports = i[2].val
7070
elseif kind(i[1]) == K"Identifier" && i[1].val == :setup
71-
if option_setup!==nothing
71+
if option_setup !== nothing
7272
push!(testerrors, (message="The keyword argument setup cannot be specified more than once.", range=testitem_range))
7373
return
7474
end
@@ -94,15 +94,15 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
9494
end
9595
end
9696

97-
if option_tags===nothing
97+
if option_tags === nothing
9898
option_tags = Symbol[]
9999
end
100100

101-
if option_default_imports===nothing
101+
if option_default_imports === nothing
102102
option_default_imports = true
103103
end
104104

105-
if option_setup===nothing
105+
if option_setup === nothing
106106
option_setup = Symbol[]
107107
end
108108

@@ -114,8 +114,8 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
114114
end
115115

116116
push!(testitems,
117-
(
118-
name=node[2,1].val,
117+
(
118+
name=node[2, 1].val,
119119
range=testitem_range,
120120
code_range=code_range,
121121
option_default_imports=option_default_imports,
@@ -132,13 +132,13 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
132132
child_nodes = children(node)
133133

134134
# Check for various syntax errors
135-
if length(child_nodes)==1
135+
if length(child_nodes) == 1
136136
push!(testerrors, (message="Your $testkind is missing a name and code block.", range=testitem_range))
137137
return
138-
elseif length(child_nodes)>1 && !(kind(child_nodes[2]) == K"Identifier")
138+
elseif length(child_nodes) > 1 && !(kind(child_nodes[2]) == K"Identifier")
139139
push!(testerrors, (message="Your $testkind must have a first argument that is an identifier for the name.", range=testitem_range))
140140
return
141-
elseif length(child_nodes)==2
141+
elseif length(child_nodes) == 2
142142
push!(testerrors, (message="Your $testkind is missing a code block argument.", range=testitem_range))
143143
return
144144
elseif !(kind(child_nodes[end]) == K"block")
@@ -150,7 +150,7 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
150150
if kind(i) != K"="
151151
push!(testerrors, (message="The arguments to a $testkind must be in keyword format.", range=testitem_range))
152152
return
153-
elseif !(length(children(i))==2)
153+
elseif !(length(children(i)) == 2)
154154
error("This code path should not be possible.")
155155
else
156156
push!(testerrors, (message="Unknown keyword argument.", range=testitem_range))
@@ -166,9 +166,9 @@ function find_test_detail!(node, testitems, testsetups, testerrors)
166166
(first(our_range(code_block))+5):(last(our_range(code_block))-3)
167167
end
168168

169-
testkind2 = if testkind==Symbol("@testmodule")
169+
testkind2 = if testkind == Symbol("@testmodule")
170170
:module
171-
elseif testkind==Symbol("@testsnippet")
171+
elseif testkind == Symbol("@testsnippet")
172172
:snippet
173173
else
174174
error("Unknown testkind")

0 commit comments

Comments
 (0)