mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
Tools: param_parse: validate empty description and fields
This commit is contained in:
parent
15421c16d1
commit
ebe841ba70
@ -35,10 +35,10 @@ args = parser.parse_args()
|
||||
|
||||
# Regular expressions for parsing the parameter metadata
|
||||
|
||||
prog_param = re.compile(r"@Param(?:{([^}]+)})?: (\w+).*((?:\n[ \t]*// @(\w+)(?:{([^}]+)})?: (.*))+)(?:\n[ \t\r]*\n|\n[ \t]+[A-Z])", re.MULTILINE)
|
||||
prog_param = re.compile(r"@Param(?:{([^}]+)})?: (\w+).*((?:\n[ \t]*// @(\w+)(?:{([^}]+)})?: ?(.*))+)(?:\n[ \t\r]*\n|\n[ \t]+[A-Z])", re.MULTILINE)
|
||||
|
||||
# match e.g @Value: 0=Unity, 1=Koala, 17=Liability
|
||||
prog_param_fields = re.compile(r"[ \t]*// @(\w+): ([^\r\n]*)")
|
||||
prog_param_fields = re.compile(r"[ \t]*// @(\w+): ?([^\r\n]*)")
|
||||
# match e.g @Value{Copter}: 0=Volcano, 1=Peppermint
|
||||
prog_param_tagged_fields = re.compile(r"[ \t]*// @(\w+){([^}]+)}: ([^\r\n]*)")
|
||||
|
||||
@ -363,6 +363,10 @@ def validate(param):
|
||||
if param.User.strip() not in ["Standard", "Advanced"]:
|
||||
error("unknown user (%s)" % param.User.strip())
|
||||
|
||||
if (hasattr(param, "Description")):
|
||||
if not param.Description or not param.Description.strip():
|
||||
error("Empty Description (%s)" % param)
|
||||
|
||||
for vehicle in vehicles:
|
||||
for param in vehicle.params:
|
||||
clean_param(param)
|
||||
|
Loading…
Reference in New Issue
Block a user