todo-to-issue-action
todo-to-issue-action copied to clipboard
Add support for language not already on Linguist?
I'm the author and maintainer of Arturo.
The language is currently used by another project, Grafito and I want to be able to keep tracking pending TODOs via this action (great idea/job, btw! :wink).
The problem is I haven't yet submitted the language to Linguist (so that I can make a PR with the definition @ syntax.json and the corresponding data), but still want to be able to have this functionality. Would I be able to make the action view specific file extensions (in our case, .art
files) as if they were written in a different language and thus processed correctly?
In Arturo, comments are pretty much REBOL/Red-like, that is like:
; this is comment
Any way this can be done?
Hey, thanks for the suggestion. :smile:
There are a couple of options that spring to mind:
- We bring
languages.yml
into this repo so it can be modified, but then it would be out of sync with future Linguist updates. - We add an optional input to
action.yml
, sayCUSTOM_LANGUAGES
, that is defined by the user inworkflow.yml
. Something like:
CUSTOM LANGUAGES: [{"name": "Arturo", "extensions": [".art"], "markers": [{"type": "line", "pattern": ";"}]}]
As far as I know it would have to be converted by the action from a string because GitHub doesn't seem to support dictionary-style inputs (please correct me if wrong).
It would check for custom languages after it does the existing check, and process them similarly.
Thanks a lot for the reply!
Unfortunately, I'm not ultra-familiar with the internals of GitHub actions (and - quite a coincidence - I'm not a huge fan of Python either lol).
However, the way you put it, I would definitely go for the 2nd option: it would do the trick, plus you could keep the main languages.yml
in sync.
Let me see what I may come up with...
Would it be better to create an external file in the workflow or the .github folder that is loaded during workflow start? Another idea is to leave a list of URLs in the action file, like 'CUSTOM LANGUAGES,' which redirects to a similar language.yml file. This would help avoid the need to rewrite the language definitions each time you create a new workflow.
That's a good idea.
Also, PR #163 included the .sht
extension which isn't referenced in languages.yml
so this could be helpful there.