Skip to content

Commit 2f48537

Browse files
Automatic JuliaFormatter.jl run (#39)
Co-authored-by: mtfishman <[email protected]>
1 parent d5430e7 commit 2f48537

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DerivableInterfaces"
22
uuid = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.4.4"
4+
version = "0.4.5"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/abstractarrayinterface.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
end
4949

5050
# Linear indexing.
51-
@interface interface ::AbstractArrayInterface function Base.getindex(
51+
@interface interface::AbstractArrayInterface function Base.getindex(
5252
a::AbstractArray, I::Int
5353
)
5454
return @interface interface getindex(a, CartesianIndices(a)[I])
@@ -62,7 +62,7 @@ end
6262
end
6363

6464
# Linear indexing.
65-
@interface interface ::AbstractArrayInterface function Base.setindex!(
65+
@interface interface::AbstractArrayInterface function Base.setindex!(
6666
a::AbstractArray, value, I::Int
6767
)
6868
return @interface interface setindex!(a, value, CartesianIndices(a)[I])
@@ -154,8 +154,9 @@ end
154154
end
155155

156156
# TODO: should this be recursive? `map!(zero!, A, A)` might also work?
157-
@interface ::AbstractArrayInterface DerivableInterfaces.zero!(A::AbstractArray) =
158-
fill!(A, zero(eltype(A)))
157+
@interface ::AbstractArrayInterface DerivableInterfaces.zero!(A::AbstractArray) = fill!(
158+
A, zero(eltype(A))
159+
)
159160

160161
# Specialized version of `Base.zero` written in terms of `zero!`.
161162
# This is friendlier for sparse arrays since `zero!` makes it easier

src/derive_macro.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ end
234234
```
235235
=#
236236
function derive_trait(type::Union{Symbol,Expr}, trait::Symbol)
237-
types = :((T=$type,))
237+
types = :((T=($type),))
238238
funcs = Expr(:block, derive(Val(trait), :T).args...)
239239
return derive_funcs(types, funcs)
240240
end

test/runtests.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ const GROUP = uppercase(
1414
)
1515

1616
"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
17-
istestfile(fn) =
18-
endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
17+
function istestfile(fn)
18+
return endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
19+
end
1920
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
20-
isexamplefile(fn) =
21-
endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
21+
function isexamplefile(fn)
22+
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
23+
end
2224

2325
@time begin
2426
# tests in groups based on folder structure

0 commit comments

Comments
 (0)