Skip to content

Commit

Permalink
verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Oct 29, 2024
1 parent b6a8d26 commit d1c7eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ImportGraph/Imports.lean
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ Returns a `List (Name × List Name)` with a key for each module `n` in `amongst`
whose corresponding value is the list of modules `m` in `amongst` which are transitively imported by `n`,
but no declaration in `n` makes use of a declaration in `m`.
-/
def unusedTransitiveImports (amongst : List Name) : CoreM (List (Name × List Name)) := do
def unusedTransitiveImports (amongst : List Name) (verbose : Bool := false) : CoreM (List (Name × List Name)) := do
let env ← getEnv
let transitiveImports := env.importGraph.transitiveClosure
let transitivelyRequired ← env.transitivelyRequiredModules' amongst
let transitivelyRequired ← env.transitivelyRequiredModules' amongst verbose
amongst.mapM fun n => do return (n,
let unused := (transitiveImports.find? n).getD {} \ (transitivelyRequired.find? n |>.getD {})
amongst.filter (fun m => unused.contains m))
Expand Down

0 comments on commit d1c7eb7

Please sign in to comment.