unfoldingWord / door43.org

Source for door43.org website.
https://door43.org
Other
4 stars 11 forks source link

UGL: Add Linter Support #712

Open jag3773 opened 6 years ago

destatez commented 5 years ago

The scope of the syntax checking is defined in https://ugl-info.readthedocs.io/en/latest/markdown.html . Currently, the checker is run on two conditions: 1) When an editor is "happy" with their edits/commit for a lemma file, they will email me that Strong's number and I will run the checker against their fork for that lemma. 2) I have a Windows scheduled daily task which will pull the latest from the main repo, do a git whatchanged for the last day, and run the checker against any that have changed. The checker is autonomous in that is knows what repo, what lemma file and what editor made the change. The Python 2 script checks the given file and automatically sends an email to that editor with either a message that there were no syntax errors or it embeds an HTML syntax error report in the body of that email.

With less than 1/3 of the lemma files edited and only 3 editors currently working part-time, it makes no sense to set up a script to look at the entire project's files. Also, Todd has not even defined what he wants the output format for this effort to look like.

What I was hoping for was a DCS means to kick off this syntax checker whenever a user does a commit against their DCS web fork (not their "local" repo, if they have one) and whenever a Merge was done after a P-R in the main repo.

RobH123 commented 5 years ago

@destatez Hi David. I've started looking at this. Where can I see a copy of your Python2 script?

RobH123 commented 5 years ago

Awaiting details of what syntax checks are required for UGL entries.

destatez commented 5 years ago

@RobH123 syntax_checker_for_ugl.zip There are currently 2 python 2 files that make up the checker. This was a way for me to easily configure between V1 and V2 of the checker. V1 is now history. I'm not real proud of the design of these (or lack thereof). The 1st param is the Strongs-Plus ID. The 2nd runtime param is a switch that dictates whether an email is automatically sent for each Strong's ID, or whether the output is written to a disk for manual concatenation of multiple files for only 1 transmittal to the editor (This done manually). The third param identifies the editor. The fourth param dictates where the checker will look for the md file: main repo, user fork, my PC-local gitlib, or my PC-local working folder. The 5th param signals that the new syntax requirements should be used. Force this to "1". Feel free to ask questions

RobH123 commented 5 years ago

@destatez Thanks for that. Just checking: the zip file contains two files: a v2 front-end and syntax_check_ugl.py (not labelled v2, parameter count doesn't match, and hardcodes self.newformat=False). Should that have been a v2 version of the check as well?