From ab55313ee9a1bde42bdffaf54ac17667ca698131 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Fri, 1 Nov 2019 08:15:17 +0700 Subject: [PATCH] Add a bit more detail to the extra kwargs warning --- src/template.jl | 4 +++- test/template.jl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/template.jl b/src/template.jl index c079f75..e3eac7b 100644 --- a/src/template.jl +++ b/src/template.jl @@ -86,7 +86,9 @@ function Template(::Val{false}; kwargs...) end end - isempty(kwargs) || @warn "Unrecognized keywords were supplied" kwargs + if !isempty(kwargs) + @warn "Unrecognized keywords were supplied, see the documentation for help" kwargs + end t = Template(authors, dir, host, julia, plugins, user) foreach(p -> validate(p, t), t.plugins) diff --git a/test/template.jl b/test/template.jl index db47e13..bea4705 100644 --- a/test/template.jl +++ b/test/template.jl @@ -46,7 +46,7 @@ @testset "Unsupported keywords warning" begin @test_logs tpl() - @test_logs (:warn, "Unrecognized keywords were supplied") tpl(; x=1, y=2) + @test_logs (:warn, r"Unrecognized keywords were supplied") tpl(; x=1, y=2) end end