Add a bit more detail to the extra kwargs warning

This commit is contained in:
Chris de Graaf 2019-11-01 08:15:17 +07:00
parent b3449ee272
commit ab55313ee9
No known key found for this signature in database
GPG Key ID: 150FFDD9B0073C7B
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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