Skip to content

Commit e704cc3

Browse files
authored
Merge pull request #111 from RelationalAI/axb-excluding-test-from-safe-logging-checks
Excluding test from safe logging checks
2 parents 7009484 + 653d2c6 commit e704cc3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/linting/extended_checks.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,12 @@ function all_arguments_are_safe(x::EXPR)
564564
return true
565565
end
566566

567-
function check(t::LogStatementsMustBeSafe, x::EXPR)
567+
function check(t::LogStatementsMustBeSafe, x::EXPR, markers::Dict{Symbol,String})
568+
if haskey(markers, :filename)
569+
# Must have "src/" in the file name, else we just
570+
contains(markers[:filename], "test/") && return
571+
end
572+
568573
error_msg = "Unsafe logging statement. You must enclose variables and strings with `@safe(...)`."
569574

570575
# @info and its friends

0 commit comments

Comments
 (0)