mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
msg_docs: fix IndexError crash and camel_to_snake regex (#26546)
Fix generate_msg_docs.py IndexError when a .msg file declares a single topic that does not match the camel_to_snake default (e.g. AuxGlobalPosition.msg). The error message referenced self.topics[1] (out of bounds) instead of self.topics[0]. Fix camel_to_snake() regex to correctly convert names like "AuxGlobalPosition" to "aux_global_position". The previous regex produced "aux_globalposition" because it failed to insert an underscore between a lowercase letter and an uppercase letter mid-word. Also remove stderr redirection (2>&1) from all make targets in metadata_sync.sh so that errors are visible in CI logs even in non-verbose mode, making failures easier to diagnose. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -123,7 +123,7 @@ generate_parameters() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make parameters_metadata
|
||||
else
|
||||
make parameters_metadata >/dev/null 2>&1
|
||||
make parameters_metadata >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ generate_airframes() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make airframe_metadata
|
||||
else
|
||||
make airframe_metadata >/dev/null 2>&1
|
||||
make airframe_metadata >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ generate_modules() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make module_documentation
|
||||
else
|
||||
make module_documentation >/dev/null 2>&1
|
||||
make module_documentation >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ generate_msg_docs() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make msg_docs
|
||||
else
|
||||
make msg_docs >/dev/null 2>&1
|
||||
make msg_docs >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ generate_uorb_graphs() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make uorb_graphs
|
||||
else
|
||||
make uorb_graphs >/dev/null 2>&1
|
||||
make uorb_graphs >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ generate_failsafe_web() {
|
||||
if [[ "$VERBOSE" == "true" ]]; then
|
||||
make failsafe_web
|
||||
else
|
||||
make failsafe_web >/dev/null 2>&1
|
||||
make failsafe_web >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user