diff --git a/Tools/px4moduledoc/srcparser.py b/Tools/px4moduledoc/srcparser.py index e34d4b1cd9..63970140b5 100644 --- a/Tools/px4moduledoc/srcparser.py +++ b/Tools/px4moduledoc/srcparser.py @@ -362,6 +362,23 @@ class SourceParser(object): print("Warning: undocumented command '%s' in %s" %(command, scope)) self._consistency_checks_failure = True + # limit the maximum line length in the module doc string + max_line_length = 120 + module_doc = module_doc.documentation() + verbatim_mode = False + line_nr = 0 + for line in module_doc.split('\n'): + line_nr += 1 + if line.strip().startswith('```'): + # ignore preformatted blocks + verbatim_mode = not verbatim_mode + elif not verbatim_mode: + if not 'www.' in line and not 'http' in line: + if len(line) > max_line_length: + print('Line too long (%i > %i) in %s:' % (len(line), max_line_length, scope)) + print(' '+line) + self._consistency_checks_failure = True + def _parse_arguments(self, contents, start_index): """ diff --git a/src/systemcmds/usb_connected/usb_connected.c b/src/systemcmds/usb_connected/usb_connected.c index 1a6b9c6b6a..8d71832061 100644 --- a/src/systemcmds/usb_connected/usb_connected.c +++ b/src/systemcmds/usb_connected/usb_connected.c @@ -51,7 +51,7 @@ __EXPORT int usb_connected_main(int argc, char *argv[]); static void print_usage() { - PRINT_MODULE_DESCRIPTION("Utility to check if USB is connected. Was previously used in startup scripts. " + PRINT_MODULE_DESCRIPTION("Utility to check if USB is connected. Was previously used in startup scripts.\n" "A return value of 0 means USB is connected, 1 otherwise." );