Skip to content

Commit e994993

Browse files
committed
Add script for running JET with options
Specifically, don't report anythin related to our unholy is_loaded_directly hack. We know it's evil, no need to see JET get twisted up about it.
1 parent a9fbc57 commit e994993

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

etc/jet.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Revise
2+
using JET
3+
4+
struct AnyFrameMethod <: ReportMatcher
5+
m::Union{Function,Method,Symbol}
6+
end
7+
8+
function JET.match_report(matcher::AnyFrameMethod, @nospecialize(report::JET.InferenceErrorReport))
9+
# check all VirtualFrames in the VirtualStackTrace for a match to the specified method
10+
m = matcher.m
11+
if m isa Symbol
12+
return any(vf -> vf.linfo.def.name === m, report.vst)
13+
elseif m isa Method
14+
return any(vf -> vf.linfo.def === m, report.vst)
15+
else # if m isa Function
16+
return any(vf -> vf.linfo.def in methods(m), report.vst)
17+
end
18+
end
19+
20+
using GAP; report_package(GAP; ignored_modules=[
21+
AnyFrameMethod(:is_loaded_directly),
22+
AnyFrameMethod(:ca_roots_path),
23+
])

0 commit comments

Comments
 (0)