Add ROS Interface#7523
Conversation
lildude
left a comment
There was a problem hiding this comment.
All three of these extensions are very generic and match a lot more non-ROS files then they do ROS based on your search queries. This will mean there's a very likely chance more files will be incorrectly classified as ROS.
IFF you can come up with a heuristic that will 100% only match ROS files, you can add the extension to generic.yml and add a heuristic - this needs to be a linear an PCRE2 compatible regex. If you can't, it's best not to add the extension and heuristic.
.msg already exists in generic.yml and already has a good regex so you only need to add a heuristic for this extension.
.action does not meet out usage requirements so I'd advise against including it at this time. User can use an override until it's popular enough for inclusion.
.msg al
|
I'm also not quite sure what is wrong with the current test failures...do I need to add more samples? |
Lines 109 to 110 in 4a1a14c Note the issue referenced.
The failures indicate your heuristic regular expressions don't match the content of your samples. This will be because they're not valid (unescaped |
|
Thanks for the tips. I believe I've fixed the redos issue, although couldn't quite figure out how to get codeql up and running in my local working copy to verify, but I did check against https://makenowjust-labs.github.io/recheck/playground/. As for PCRE2 compatibility, I believe they already were and still are compatible according to https://regex101.com, but let me know if you're seeing otherwise. |
* Add ROS Interface language grammar * Update submodule * update heuristics * some test fixes * Update submodule * fix unescaped /, redos, and incorrect negative pattern * update license cache --------- Co-authored-by: Colin Seymour <colin@github.com>

Adding a language grammar for ROS interfaces (messages, services, and actions).
Resolves #5619
Description
Checklist:
.msghttps://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.msg+std_msgs+OR+geometry_msgs+OR+builtin_interfaces.srvhttps://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.srv+std_msgs+OR+geometry_msgs+OR+builtin_interfaces.actionhttps://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.action+std_msgs+OR+geometry_msgs+OR+builtin_interfaces#22314e