Skip to content

Commit

Permalink
fix exclude-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Feb 13, 2024
1 parent 9618fa9 commit 0bf1cdc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ImportGraph/Cli.lean
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def importGraphCLI (args : Cli.Parsed) : IO UInt32 := do
graph := graph.filterMap (fun n i =>
if p.isPrefixOf n then (i.filter (isPrefixOf p)) else none)
if args.hasFlag "exclude-meta" then
let filterMeta : Name → Bool := fun n => (
isPrefixOf `Graph.Lean.Tactic n ∨
isPrefixOf `Graph.Lean n ∨
isPrefixOf `Graph.Lean.Mathport n ∨
isPrefixOf `Graph.Lean.Util n)
graph := graph.filterGraph filterMeta (replacement := `«Graph.Lean.Tactics»)
-- Mathlib-specific exclusion of tactics
let filterMathlibMeta : Name → Bool := fun n => (
isPrefixOf `Mathlib.Lean.Tactic n ∨
isPrefixOf `Mathlib.Lean n ∨
isPrefixOf `Mathlib.Lean.Mathport n ∨
isPrefixOf `Mathlib.Lean.Util n)
graph := graph.filterGraph filterMathlibMeta (replacement := `«Mathlib.Lean.Tactics»)
if args.hasFlag "reduce" then
graph := graph.transitiveReduction
return asDotGraph graph
Expand Down

0 comments on commit 0bf1cdc

Please sign in to comment.