Skip to content

chore: add format specifiers to interpolated string holes#4821

Merged
dbrattli merged 1 commit into
mainfrom
fix/code-scanning-interpolated-format-specifiers
Jul 19, 2026
Merged

chore: add format specifiers to interpolated string holes#4821
dbrattli merged 1 commit into
mainfrom
fix/code-scanning-interpolated-format-specifiers

Conversation

@dbrattli

Copy link
Copy Markdown
Collaborator

Resolves all 5 open code scanning alerts, which are the same rule: GRA-INTERPOLATED-001"Interpolated hole expression without format detected. Use prefix with the correct % to enforce type safety."

Alert Location
#1553 src/Fable.Transforms/FSharp2Fable.fs:568
#903 src/Fable.Compiler/MSBuildCrackerResolver.fs:167
#902 src/Fable.Compiler/MSBuildCrackerResolver.fs:164
#901 src/Fable.Compiler/MSBuildCrackerResolver.fs:105
#900 src/Fable.Compiler/MSBuildCrackerResolver.fs:102

Each untyped hole gets the specifier matching its value: %s for the two string holes (targetFrameworkJson, json, unionCase.Name) and %O for the two exn holes (ex), which keeps the existing ToString()-based rendering.

Output text is unchanged; this is purely about making the interpolations type-checked.

Verified with dotnet build src/Fable.Compiler/Fable.Compiler.fsproj (succeeds, 0 warnings — this also covers Fable.Transforms) and dotnet fantomas --check on both files.

🤖 Generated with Claude Code

Resolves the open GRA-INTERPOLATED-001 code scanning alerts. Untyped
interpolation holes are replaced with %s (strings) and %O (exceptions)
so the interpolations are type-checked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dbrattli dbrattli changed the title fix(compiler): add format specifiers to interpolated string holes chore: add format specifiers to interpolated string holes Jul 19, 2026
@dbrattli
dbrattli merged commit 2ba9511 into main Jul 19, 2026
47 of 48 checks passed
@dbrattli
dbrattli deleted the fix/code-scanning-interpolated-format-specifiers branch July 19, 2026 19:01
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