feat: 1) support length_not_equal comparison; 2) All length comparators support numbers; 3) Optimize the is_true and is_not_true comparisons#5218
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
9e205a9 to
b8cb954
Compare
| if not match: | ||
| regex = fnmatch.translate(wildcard) | ||
| match = re.compile(regex).match | ||
| match = re.compile(regex).fullmatch |
There was a problem hiding this comment.
注:与正则比较器相同的调整。see e86ae7e
但其实最终效果是一样的,因为经过 fnmatch.translate(wildcard) 转换后的正则,会以 \Z 结尾,它的效果和 fullmatch 一样,就是从代码层面明确最终使用的是fullmatch 的效果,更容易让人理解。
| return source_value is True | ||
| except Exception: | ||
| return False | ||
| return source_value is True |
There was a problem hiding this comment.
is_not_true 和 is_true 没有异常需要捕获,直接去掉。
length_not_equal comparison; 2) All length comparators support numberslength_not_equal comparison; 2) All length comparators support numbers; 3) Optimize the is_true and is_not_true comparisons
…tors support numbers; 3) Optimize the `is_true` and `is_not_true` comparisons
4f4867b to
35516f5
Compare
What this PR does / why we need it?
length_not_equalcomparisonis_trueandis_not_truecomparisonsSummary of your change
长度不等于 (len_not_eq)比较is_true和is_not_true判断器Please indicate you've done the following: