Skip to content

Commit 8689063

Browse files
committed
Log an error if multiple subactions are registered for the same language.
1 parent 2ed5b5b commit 8689063

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

finecode_extension_runner/src/finecode_extension_runner/impls/project_action_runner.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ def get_actions_for_parent(self, parent_action_type: type) -> dict[str, type]:
107107
if getattr(cls, "PARENT_ACTION", None) is parent_action_type:
108108
lang = getattr(cls, "LANGUAGE", None)
109109
if lang is not None:
110+
if lang in result:
111+
logger.error(
112+
"Multiple subactions registered for language {!r} under parent"
113+
" {!r}: {!r} and {!r}. Only one subaction per language is"
114+
" allowed; {!r} will be ignored.",
115+
lang,
116+
parent_action_type,
117+
result[lang],
118+
cls,
119+
result[lang],
120+
)
110121
result[lang] = cls
111122
return result
112123

0 commit comments

Comments
 (0)