refactor: Remove redundent imports
This commit is contained in:
parent
5bcf3b3962
commit
f3cb311028
54 changed files with 35 additions and 129 deletions
29
scripts/MetaPrograms/redundent_imports.lean
Normal file
29
scripts/MetaPrograms/redundent_imports.lean
Normal file
|
@ -0,0 +1,29 @@
|
|||
/-
|
||||
Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved.
|
||||
Released under Apache 2.0 license.
|
||||
Authors: Joseph Tooby-Smith
|
||||
-/
|
||||
import HepLean.Meta.Basic
|
||||
import ImportGraph.Imports
|
||||
/-!
|
||||
|
||||
# Extracting commands with no doc strings.
|
||||
|
||||
-/
|
||||
|
||||
open Lean System Meta HepLean
|
||||
|
||||
|
||||
def Imports.RedundentImports (imp : Import) : MetaM UInt32 := do
|
||||
let x ← redundantImports (some imp.module)
|
||||
if x.isEmpty then return 0
|
||||
println! "\n"
|
||||
println! (← Name.toFile imp.module)
|
||||
println! x.toList
|
||||
return 0
|
||||
|
||||
unsafe def main (_ : List String) : IO UInt32 := do
|
||||
initSearchPath (← findSysroot)
|
||||
let imports ← allImports
|
||||
let _ ← CoreM.withImportModules #[`HepLean] (imports.mapM Imports.RedundentImports).run'
|
||||
return 0
|
Loading…
Add table
Add a link
Reference in a new issue