Skip to content

Commit 349a9ab

Browse files
Automatic ITensorFormatter run (#23)
Co-authored-by: mtfishman <7855256+mtfishman@users.noreply.github.com>
1 parent a5e7e53 commit 349a9ab

File tree

8 files changed

+29
-18
lines changed

8 files changed

+29
-18
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BackendSelection"
22
uuid = "680c2d7c-f67a-4cc9-ae9c-da132b1447a5"
3-
version = "0.1.9"
3+
version = "0.1.10"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[compat]

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ makedocs(;
1414
format = Documenter.HTML(;
1515
canonical = "https://itensor.github.io/BackendSelection.jl",
1616
edit_link = "main",
17-
assets = ["assets/favicon.ico", "assets/extras.css"],
17+
assets = ["assets/favicon.ico", "assets/extras.css"]
1818
),
19-
pages = ["Home" => "index.md", "Reference" => "reference.md"],
19+
pages = ["Home" => "index.md", "Reference" => "reference.md"]
2020
)
2121

2222
deploydocs(;

docs/make_index.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Literate: Literate
21
using BackendSelection: BackendSelection
2+
using Literate: Literate
33

44
function ccq_logo(content)
55
include_ccq_logo = """
@@ -17,5 +17,5 @@ Literate.markdown(
1717
joinpath(pkgdir(BackendSelection), "docs", "src");
1818
flavor = Literate.DocumenterFlavor(),
1919
name = "index",
20-
postprocess = ccq_logo,
20+
postprocess = ccq_logo
2121
)

docs/make_readme.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Literate: Literate
21
using BackendSelection: BackendSelection
2+
using Literate: Literate
33

44
function ccq_logo(content)
55
include_ccq_logo = """
@@ -17,5 +17,5 @@ Literate.markdown(
1717
joinpath(pkgdir(BackendSelection));
1818
flavor = Literate.CommonMarkFlavor(),
1919
name = "README",
20-
postprocess = ccq_logo,
20+
postprocess = ccq_logo
2121
)

src/backend_types.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ function generate_backend_type_expr(type::Symbol)
2020
kwargs::Kwargs
2121
end
2222

23-
$type{Back}(kwargs::NamedTuple) where {Back} = $type{Back, typeof(kwargs)}(kwargs)
23+
function $type{Back}(kwargs::NamedTuple) where {Back}
24+
return $type{Back, typeof(kwargs)}(kwargs)
25+
end
2426
$type{Back}(; kwargs...) where {Back} = $type{Back}(NamedTuple(kwargs))
2527
$type(s; kwargs...) = $type{Symbol(s)}(NamedTuple(kwargs))
2628

@@ -40,13 +42,15 @@ function generate_backend_type_expr(type::Symbol)
4042

4143
function Base.show(io::IO, backend::$type)
4244
return print(
43-
io, "$($type) type ", backend_string(backend), ", ", parameters(backend)
45+
io, "$($type) type ", backend_string(backend), ", ", parameters(
46+
backend
47+
)
4448
)
4549
end
4650
function Base.print(io::IO, backend::$type)
4751
return print(io, backend_string(backend), ", ", parameters(backend))
4852
end
49-
end,
53+
end
5054
)
5155
end
5256

test/runtests.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ const GROUP = uppercase(
1010
get(ENV, "GROUP", "ALL")
1111
else
1212
only(match(pat, ARGS[arg_id]).captures)
13-
end,
13+
end
1414
)
1515

16-
"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
16+
"""
17+
match files of the form `test_*.jl`, but exclude `*setup*.jl`
18+
"""
1719
function istestfile(fn)
18-
return endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
20+
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
21+
!contains(fn, "setup")
1922
end
20-
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
23+
"""
24+
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
25+
"""
2126
function isexamplefile(fn)
2227
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
2328
end
@@ -57,7 +62,7 @@ end
5762
:macrocall,
5863
GlobalRef(Suppressor, Symbol("@suppress")),
5964
LineNumberNode(@__LINE__, @__FILE__),
60-
:(include($filename)),
65+
:(include($filename))
6166
)
6267
)
6368
end

test/test_aqua.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using BackendSelection: BackendSelection
21
using Aqua: Aqua
2+
using BackendSelection: BackendSelection
33
using Test: @testset
44

55
@testset "Code quality (Aqua.jl)" begin

test/test_basics.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ using TestExtras: @constinferred
2828
end
2929
end
3030
# Macro syntax.
31-
@test @constinferred(Algorithm"backend"(; x = 2, y = 3)) === Algorithm("backend"; x = 2, y = 3)
32-
@test @constinferred(Backend"backend"(; x = 2, y = 3)) === Backend("backend"; x = 2, y = 3)
31+
@test @constinferred(Algorithm"backend"(; x = 2, y = 3)) ===
32+
Algorithm("backend"; x = 2, y = 3)
33+
@test @constinferred(Backend"backend"(; x = 2, y = 3)) ===
34+
Backend("backend"; x = 2, y = 3)
3335
@test isnothing(show(Algorithm("")))
3436
end

0 commit comments

Comments
 (0)