Skip to content

Commit 0df65d8

Browse files
committed
add annotation error if no type is provided to tendency
1 parent a872f68 commit 0df65d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

waveform_editor/waveform.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ def _handle_tendency(self, entry):
126126
Returns:
127127
The created tendency or None, if the tendency cannot be created
128128
"""
129+
if "type" not in entry:
130+
line_number = entry.pop("line_number")
131+
error_msg = (
132+
"The tendency must have a 'type'.\n"
133+
"For example: '- {type: constant, duration: 3, value: 3}'\n"
134+
"This tendency will be ignored."
135+
)
136+
self.annotations.add(line_number, error_msg)
137+
return None
129138
tendency_type = entry.pop("type")
130139

131140
# Rewrite keys

0 commit comments

Comments
 (0)