Migrating alpha file import to lean + adding testing - #1552
Conversation
…inter rules, and created testing lean script2
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
There was a problem hiding this comment.
This is not quite what I had in mind for the Meta file.
I was thinking e.g. withing the ./PhyslibAlpha project not as a seperate project. Maybe we should save these tests for a future PR, and look at Mathlib to see what they do here.
There was a problem hiding this comment.
I wasn't too happy with it either. I've temporarily removed it and when I get the chance I'll try to look at Mathlib.
|
awaiting-author |
|
|
||
| def checkAllFilesImported (directory : String) (mainFilePath : String) : (IO Bool) := do | ||
| let modules : HashSet String := HashSet.ofArray $ (← getFilePaths directory).map extractModuleNameFromFilePath | ||
|
|
There was a problem hiding this comment.
Maybe would be nice to remove these new lines from within definitions.
There was a problem hiding this comment.
I've removed the newlines, if there's some other style changes you'd like to make let me know.
There was a problem hiding this comment.
For meta programming I think it is a bit more loose than the Lean code itself. But the main ones are this, definitions should be written like checkAllFilesImported not like check_all_files_imported, and generally make things concise and readable where possible.
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved - looks good. Thanks
Creates
alphaFileImports.lean, replacingalphaFileImports.py. Adjusts workflows andAGENTS.mdto use this new script.Adds
alphaFileImports.leanandnoAlphaImports.leantolint_all.lean.Adds
./Meta/testdirectory containing a dummy projecttest_projectand a test scripttestImportScripts.leanthat testsalphaFileImports.leanandnoAlphaImports.leanfail correctly on the dummy project.