Fix WithHandler semgrep false positive#418
Draft
proboscis wants to merge 1 commit into
Draft
Conversation
Owner
Author
|
config-effects 確認結果: 対象外です。 この PR は そのため、この確認では修正要求はありません。current head: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
HYP-158 の実装です。
doeff-withhandler-no-return-clauseがdoeff/program.pyの互換 shim 内部引き渡しを誤検出しないようにしつつ、外部の旧WithHandler呼び出し禁止は維持しました。変更内容
.semgrep.yamlで_WithHandlerNode(h, body, *args, **kwargs)の shim 転送 1 行だけを除外tests/semgrep/fixtures/python/doeff/withhandler_return_clause_sample.pyと semgrep pytest を追加し、return_clause指定・3 番目位置引数・doeff_vm.WithHandler旧形式が引き続き検出されることを固定確認したこと
semgrep --config .semgrep.yaml --include 'doeff/program.py' doeff/uv run pytest tests/semgrep/test_vm_failfast_semgrep_rules.py -quv run pytest tests/public_api/test_types_001_validation.py -qgit diff --check --cached/uv run ruff check tests/semgrep/test_vm_failfast_semgrep_rules.py tests/semgrep/fixtures/python/doeff/withhandler_return_clause_sample.pyUI 証跡確認
UI や表示文言の変更ではないため対象外です。