Add support for multiple comment marker types
See original GitHub issueAt the moment the action just accepts one comment marker, such as #
.
This is fine for single-language projects, but where you have multiple languages you may need to use comments with a different syntax. For example, you might have a Python app that also has some CSS files /* with comments like this */
.
One option would be to allow multiple markers in the config, but that could get a bit unwieldy, and you may not always know in advance.
As the action already performs a language lookup when processing each file in the diff, it may be good to use that to determine the comment syntax for the file in question. How we do that, without hardcoding everything (a huge and perhaps impractical task), I’m not sure at the moment.
A workaround at the moment is to set up the action to run multiple times, once for each comment marker type. Obviously this is not the most efficient solution, though.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:13 (7 by maintainers)
Top GitHub Comments
I have a completely rewritten version of the action almost ready. It processes comments dynamically, using the dictionary method mentioned previously. Will have it available for trying out soon.
I have been thinking about that. I’m part way through developing a method that works similar to how @ChocolateLoverRaj mentioned, but I might see about this.
The action already looks up the file type for Markdown styling, so I’m planning to use that to check the comment syntax. But yeah, there aren’t too many different formats, so hopefully that will make things more manageable.
I’ll see how testing goes, but hopefully will have something soon.