Skip to content

feat: EvaluatorRuleArgs允许自由拓展#431

Merged
shijinpjlab merged 2 commits into
MigoXLab:devfrom
shijinpjlab:dev_0612
Jun 12, 2026
Merged

feat: EvaluatorRuleArgs允许自由拓展#431
shijinpjlab merged 2 commits into
MigoXLab:devfrom
shijinpjlab:dev_0612

Conversation

@shijinpjlab

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies rule configuration by allowing EvaluatorRuleArgs to accept extra fields directly, removing the need for a nested parameters dictionary. The documentation and the RuleDictConsistency rule have been updated to reflect this change. The review feedback points out a potential issue where getattr might return None if ignore_order is explicitly configured as null, and suggests a robust boolean check to ensure it defaults to True correctly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

right_dict = getattr(input_data, "context", None)
parameters = cls.dynamic_config.parameters or {}
ignore_order = parameters.get("ignore_order", True)
ignore_order = getattr(cls.dynamic_config, "ignore_order", True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When retrieving the dynamic configuration ignore_order using getattr, if the attribute is explicitly configured as None (e.g., "ignore_order": null in JSON), getattr will return None instead of the default value True. Since _normalize_value expects a boolean, this can lead to unexpected behavior where ignore_order is treated as False (falsy) but passed recursively as None.

To ensure robust defensive programming and guarantee that ignore_order is always a proper boolean (defaulting to True unless explicitly set to False), we can use is not False comparison.

Suggested change
ignore_order = getattr(cls.dynamic_config, "ignore_order", True)
ignore_order = getattr(cls.dynamic_config, "ignore_order", True) is not False

@shijinpjlab shijinpjlab merged commit cfd0cae into MigoXLab:dev Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant