Conversation
|
This is not something I'm knowledgeable in so take my suggestion with a grain of salt, but this is what I figured out from looking at error messages. I believe the only issue with the Python based style linter is that only certain commands are allowed before the module doc-string, imports being one of them, and it's complaining now that imports have if words[0] != "import" and words[0] != "--" and words[0] != "/-!" and words[0] != "#align_import":I think it should work if you change this to if words[0] != "module" and words[0] != "public" and words[0] != "--" and words[0] != "/-!" and words[0] != "#align_import":These are essentially the only ways that lines are allowed to start before doing the module doc-string. |
|
I think the https://lean-lang.org/doc/reference/latest/Source-Files-and-Modules/#meta-phase Not sure exactly how this works, but an example is here: I will try and experiment when I get chance. |
|
I think I fixed most changes, I had to remove all |
|
update: I now realise I can do Edit: tried hacking my way through more of it, but the |
|
There was somewhere you added |
|
@copilot What files in this PR contain changes other than standard changes going to the module system. |
|
@jstoobysmith I've opened a new pull request, #980, to work on those changes. Once the pull request is ready, I'll request review from you. |
This didn't do what I intended - sorry for the noise :). |
|
@jstoobysmith I've opened a new pull request, #981, to work on those changes. Once the pull request is ready, I'll request review from you. |
This is the final commit, in wickcontraction/extractequiv |
|
I'm not sure what Other changes are in mathematics/list.lean and files that import it, maybe you can look for |
|
Will do - |
|
I would like to see how far we could get without actually modifying the Lean code in the works better here, then using But I am not sure the consequences there of. Also... just seems to work. |
|
I fixed the lists parts using the module system so reverted some of your changes. Two further questions:
|
|
Should be the remaining changes For linters I only changed lint-style.py following @morrison-daniel 's comment above and hard coding the first word of different import statements |
|
If you mean the sorryful attributes, changing it to public meta imports seems to solve the issues, but I'm not sure if it works (is |
|
Yeah I think your method works here. This all looks good to me now. I'll check through the files again sometime this afternoon. But then will approve. When we merge this we should probably post on the Zulip given that it is a fairly big change. |
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved - you should be able to merge after linters.
Many thanks for doing this.
Ran Modulize.lean (placed the file under
scriptsfolder).There's some metaprogramming things that I'm not quite sure how to fix, consulted ChatGPT which managed to remove all errors, but I'm completely lost and would like to ask for a double check. The changes are in
PhysLean/Meta/Basic.lean, other changes are just meta imports/ meta defs.Removed
privatelemma labels inPhysLean/Mathematics/SchurTriangulation.leanandPhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean. Those broke the files so I removed them for now, not sure what's the correct way to label them in the module system.Currently I'm stuck at
sorryfuldeclarations, where there's no error in the file, but the build fails with error messageUnknown attribute[Sorryful_attr](e.g.PhysLean/ClassicalMechanics/Pendulum/CoplanarDoublePendulum.lean). I believe there's a same issue with thepseudoattribute. Can't figure this out and would like to ask for assistance.Edit: I guess the github workflows should also be updated