Yaskawa-Global / motoros2

ROS 2 (rcl, rclc & micro-ROS) node for MotoPlus-compatible Yaskawa Motoman robot controllers
96 stars 20 forks source link

Improve subcode doc linter: report heading parsing failures as errors #165

Closed gavanderhoorn closed 1 year ago

gavanderhoorn commented 1 year ago

This improves the alarm doc linter script and makes it report errors for each heading in the Markdown document it failed to parse.

Such parsing failures typically result in the same linter later reporting "no documentation" for a subcode, but without knowledge about the parsing failure such messages are misleading (and then lead to issues such as #160).

Example output (after introducing some errors in doc/troubleshooting.md):

doc/troubleshooting.md:663:0: error: failed to parse 'Alarm: 8011[56] - [58]'
doc/troubleshooting.md:691:0: error: failed to parse 'Alarm: 8011[60  62]'
doc/troubleshooting.md:849:0: error: failed to parse 'Alarm: 8013[8 or 9]'
doc/troubleshooting.md:920:0: error: failed to parse 'Alarm: 8013[14'
src/ErrorHandling.h:187:5: error: no documentation for '8013[8]' in 'doc/troubleshooting.md'
src/ErrorHandling.h:188:5: error: no documentation for '8013[9]' in 'doc/troubleshooting.md'
src/ErrorHandling.h:194:5: error: no documentation for '8013[14]' in 'doc/troubleshooting.md'
gavanderhoorn commented 1 year ago

I temporarily added 81643b4b to show what the result would be if the linter encountered parsing errors. See this run.

I'll remove the commit from the PR.