-
Notifications
You must be signed in to change notification settings - Fork 324
[Python] Fix unsafe option unwrapping in Replacements.fs#4480
Merged
dbrattli merged 4 commits intoApr 3, 2026
Merged
Conversation
@github-actions
github-actions
Bot
added
automation
Automated changes
repo-assist
Created by Repo Assist
labels
Apr 3, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
Python Type Checking Results (Pyright)
Excluded files with errors (4 files)These files have known type errors and are excluded from CI. Remove from
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dbrattli
dbrattli
changed the title
(削除) [Repo Assist] [Python] Fix unsafe option unwrapping in Replacements.fs (IONIDE-006 alerts #1521, #1203) (削除ここまで)
(追記) [Python] Fix unsafe option unwrapping in Replacements.fs (追記ここまで)
Apr 3, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dbrattli
dbrattli
deleted the
repo-assist/codescan-1521-1203-py-unsafe-option-1c8fc098f6d8fee5
branch
April 3, 2026 07:48
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.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes unsafe
.Valueaccesses onthisArg: Expr optionin PythonReplacements.fs:DateTimeOffset.get_Offset:thisArg.Valueused without checking ifthisArgisSomeget_Options,get_Index,get_Value,get_Length,get_Success,get_Item,GetEnumerator) all usedthisArg.Valuedirectlymatch thisArg with Some -> ... |> Some | None -> Nonepatterns to useOption.mapfor consistency and concisenessAll fixes follow the established pattern already used elsewhere in the file (e.g.,
get_Count).Test plan
dotnet buildpassesCo-authored-by: Dag Brattli dag@brattli.net