Complete this form and hit the "Save Changes" button!
No ratings
Are you sure you want to delete this code? Please type DELETE in the box below to confirm.
Are you sure you want to verify this code?
Are you sure you want to publish this code?
Are you sure you want to unpublish this code?
Are you sure you want to autogenerate the summary + description for this code?
xxxxxxxxxx
open IO FS System FilePath
def trimEnds (s : String) : String :=
(s.split (· == '\n')).map (·.dropRightWhile (· == ' ')) |> String.intercalate "\n"
def main (args : List String) : IO Unit :=
match args with
| [] => println "No root directory provided!"
| d :: _ =>
for fp in ← walkDir d do
if fp.extension == some "lean" then
let text ← readFile fp
writeFile fp (trimEnds text)