From c9714e9dfe996d0cdb383663e08169ebb07e867b Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:26:23 +0100 Subject: [PATCH] Reformat --- docs/make.jl | 41 +++++++++++++++++++---------------------- src/trixi_include.jl | 2 -- test/trixi_include.jl | 16 ++++++++-------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 8afb922..6f9206c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,7 +4,8 @@ using Documenter trixibase_root_dir = dirname(@__DIR__) # Fix for https://github.com/trixi-framework/Trixi.jl/issues/668 -if (get(ENV, "CI", nothing) != "true") && (get(ENV, "TRIXIBASE_DOC_DEFAULT_ENVIRONMENT", nothing) != "true") +if (get(ENV, "CI", nothing) != "true") && + (get(ENV, "TRIXIBASE_DOC_DEFAULT_ENVIRONMENT", nothing) != "true") push!(LOAD_PATH, trixibase_root_dir) end @@ -36,26 +37,22 @@ copy_file("LICENSE.md", "\n" => "\n> ", r"^" => "# License\n\n> ") # Make documentation -makedocs( - sitename="TrixiBase.jl", - # Provide additional formatting options - format = Documenter.HTML( - # Disable pretty URLs during manual testing - prettyurls = get(ENV, "CI", nothing) == "true", - # Set canonical URL to GitHub pages URL - canonical = "https://trixi-framework.github.io/TrixiBase.jl/stable" - ), - # Explicitly specify documentation structure - pages = [ - "Home" => "index.md", - "API reference" => "reference.md", - "Authors" => "authors.md", - "License" => "license.md" - ], -) +makedocs(sitename="TrixiBase.jl", + # Provide additional formatting options + format=Documenter.HTML( + # Disable pretty URLs during manual testing + prettyurls=get(ENV, "CI", nothing) == "true", + # Set canonical URL to GitHub pages URL + canonical="https://trixi-framework.github.io/TrixiBase.jl/stable"), + # Explicitly specify documentation structure + pages=[ + "Home" => "index.md", + "API reference" => "reference.md", + "Authors" => "authors.md", + "License" => "license.md", + ]) deploydocs(; - repo = "github.com/trixi-framework/TrixiBase.jl", - devbranch = "main", - push_preview = true -) + repo="github.com/trixi-framework/TrixiBase.jl", + devbranch="main", + push_preview=true) diff --git a/src/trixi_include.jl b/src/trixi_include.jl index 5598130..80b9fd4 100644 --- a/src/trixi_include.jl +++ b/src/trixi_include.jl @@ -102,8 +102,6 @@ end walkexpr(f, expr::Expr) = f(Expr(expr.head, (walkexpr(f, arg) for arg in expr.args)...)) walkexpr(f, x) = f(x) - - # Replace assignments to `key` in `expr` by `key = val` for all `(key,val)` in `kwargs`. function replace_assignments(expr; kwargs...) # replace explicit and keyword assignments diff --git a/test/trixi_include.jl b/test/trixi_include.jl index c4728cd..186f284 100644 --- a/test/trixi_include.jl +++ b/test/trixi_include.jl @@ -16,14 +16,14 @@ @test @isdefined x @test x == 4 - @test_nowarn trixi_include(@__MODULE__, filename, x = 7) + @test_nowarn trixi_include(@__MODULE__, filename, x=7) @test x == 7 @test_throws "assignment `y` not found in expression" trixi_include(@__MODULE__, filename, - y = 3) + y=3) finally - rm(filename, force = true) + rm(filename, force=true) end end @@ -48,9 +48,9 @@ @test_throws "no method matching solve(; maxiters::Int64)" trixi_include(@__MODULE__, filename, - maxiters = 3) + maxiters=3) finally - rm(filename, force = true) + rm(filename, force=true) end end @@ -85,12 +85,12 @@ @test x == 10^5 @test_nowarn trixi_include(@__MODULE__, filename2, - maxiters = 7) + maxiters=7) # Test that `maxiters` got overwritten @test x == 7 finally - rm(filename1, force = true) - rm(filename2, force = true) + rm(filename1, force=true) + rm(filename2, force=true) end end end