Add support for annotating lua model files#3
Open
cycomachead wants to merge 1 commit intoleafo:masterfrom
Open
Add support for annotating lua model files#3cycomachead wants to merge 1 commit intoleafo:masterfrom
cycomachead wants to merge 1 commit intoleafo:masterfrom
Conversation
cycomachead
commented
May 21, 2024
|
|
||
| if password = config.postgres.password | ||
| table.insert 1, command, "PGPASSWORD=#{shell_escape password}" | ||
| table.insert command, 1, "PGPASSWORD=#{shell_escape password}" |
Author
There was a problem hiding this comment.
Probably should have made this a separate PR (happy to, if helpful) but this seems like a genuine typo. :)
cycomachead
commented
May 21, 2024
|
|
||
| -- TODO: this is kinda sloppy and only works with MoonScript | ||
| unless updated_source | ||
| -- TODO: this is kinda sloppy |
Author
There was a problem hiding this comment.
I kept the comment for no particular reason, but edited to at least not be false. 🙃
Obviously, this could be more flexible, but it does seem to work fine for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @leafo,
Is there interest in supporting lapis projects which do not use Moonscript?
I have re-written this since the last PR, and thanks to the refactoring, it's now quite simple. :)
I was able to successfully use this for the following PR in our lapis app.
https://github.com/snap-cloud/snapCloud/pull/355/files#diff-536051a826b3ce1fdc058ac7368426038abf2f72a096067103c1ed7e82665ee0
I opted to be a little flexible with the declaration syntax or the model class
local %w+ = Model:extendto insert the annotations. (I was going to strictly follow camelCase, but ran into one case where our variable name didn't exactly match thecamelizefunction.) Of course, the does require you use local variables and not renameModel, but I think those are acceptable compromises.I will re-add the docs if you think this is helpful.
Thanks!