Handle LIB_GE_CREATE_obj and LIB_GE_CONF_define_IPL_conditions in poco_plugin #76
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
state: Done
state: New
type: Bug
type: Feature
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Christoph/nx_post_support!76
Loading…
Reference in a new issue
No description provided.
Delete branch "74-lib-ge-create-obj-not-recognised-correctly"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change registers two new command handlers in
server/src/plugins/poco_plugin.pyand imports the builtin commands table used by one of them.What changed
from tclint.commands.builtin import commands as _builtin_commands._lib_ge_create_obj(args, parser)which performs argument validation and parses the third argument as a script._lib_ge_conf_define_ipl_conditions(args, parser)which validates an IPL-styleifform and delegates the conditional parsing to the builtinifhandler.commandslist:LIB_GE_CREATE_objandLIB_GE_CONF_define_IPL_conditions.Behavior details
LIB_GE_CREATE_objhandler:CommandArgErrorwith a message expecting 3 args.parser.parse_scriptonargs[2]and returns the updated args.len(args) < 1 or len(args) > 3), but later unconditionally indexesargs[2]whenlen(args) != 1. That indexing would raiseIndexErrorforlen(args) == 2. The code also special-cases a singleBracedWordas an error. Please verify intended arity and whether 2-argument forms should be accepted or rejected.LIB_GE_CONF_define_IPL_conditionshandler:args[2].contents == "if"; otherwise raisesCommandArgErrorwith an explanatory expected format.ifcommand handler (_builtin_commands["if"]) and returnsargs[:3]concatenated with that result.Why this matters
LIB_GE_CREATE_objandLIB_GE_CONF_define_IPL_conditions). That affects how scripts using these commands are processed by this plugin integration.Testing
No test execution results were provided.
Recommended checks for reviewers/local testing:
Unit tests / direct calls to the handlers:
LIB_GE_CREATE_obj:parser.parse_scriptis called on the 3rd arg and that result is returned.CommandArgError.IndexErroroccurs; confirm intended behavior and adjust implementation accordingly.LIB_GE_CONF_define_IPL_conditions:if-style sequences (>=5 args,args[2].contents == "if"): verify it delegates to the builtinifhandler and returns a combined arg list.ifor too few args): verifyCommandArgErroris raised.Integration: run any existing tclint or plugin integration checks against sample scripts that use
LIB_GE_CREATE_objandLIB_GE_CONF_define_IPL_conditions.Compatibility / Risks
IndexErrorin_lib_ge_create_objfor 2-argument inputs should be reviewed and fixed if 2-argument forms are not intended to be accepted.Reviewer notes
LIB_GE_CREATE_objand either tighten the validation to reject 2-argument calls or guard the indexing/behavior for 2-argument cases._builtin_commandsis acceptable in this module and that the builtinifhandler signature matches the delegated call pattern used here.Closes #74