Skip to content

Commit 3347e69

Browse files
fix(style): use double quotes in tool_name_validation.py per ruff config
Replace single-quoted string literals with double quotes in BIDIRECTIONAL_FORMATTING_CHARS set and unicodedata.normalize call.
1 parent 7bdaa23 commit 3347e69

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/mcp/shared/tool_name_validation.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626

2727
# Bidirectional formatting characters that can be used to obfuscate tool names
2828
BIDIRECTIONAL_FORMATTING_CHARS = {
29-
'‎', # LEFT-TO-RIGHT MARK
30-
'‏', # RIGHT-TO-LEFT MARK
31-
'‪', # LEFT-TO-RIGHT EMBEDDING
32-
'‫', # RIGHT-TO-LEFT EMBEDDING
33-
'‬', # POP DIRECTIONAL FORMATTING
34-
'‭', # LEFT-TO-RIGHT OVERRIDE
35-
'‮', # RIGHT-TO-LEFT OVERRIDE
36-
'⁦', # LEFT-TO-RIGHT ISOLATE
37-
'⁧', # RIGHT-TO-LEFT ISOLATE
38-
'⁨', # FIRST STRONG ISOLATE
39-
'⁩', # POP DIRECTIONAL ISOLATE
40-
'؜', # ARABIC LETTER MARK
29+
"‎", # LEFT-TO-RIGHT MARK
30+
"‏", # RIGHT-TO-LEFT MARK
31+
"‪", # LEFT-TO-RIGHT EMBEDDING
32+
"‫", # RIGHT-TO-LEFT EMBEDDING
33+
"‬", # POP DIRECTIONAL FORMATTING
34+
"‭", # LEFT-TO-RIGHT OVERRIDE
35+
"‮", # RIGHT-TO-LEFT OVERRIDE
36+
"⁦", # LEFT-TO-RIGHT ISOLATE
37+
"⁧", # RIGHT-TO-LEFT ISOLATE
38+
"⁨", # FIRST STRONG ISOLATE
39+
"⁩", # POP DIRECTIONAL ISOLATE
40+
"؜", # ARABIC LETTER MARK
4141
}
4242

4343

@@ -92,7 +92,7 @@ def validate_tool_name(name: str) -> ToolNameValidationResult:
9292
# NFKC is the compatibility normalization form that converts:
9393
# - Fullwidth characters to ASCII (a → a)
9494
# - Composed characters to canonical form
95-
normalized = unicodedata.normalize('NFKC', name)
95+
normalized = unicodedata.normalize("NFKC", name)
9696
if normalized != name:
9797
warnings.append(
9898
f"Tool name contains Unicode characters that normalize to a different form. "

0 commit comments

Comments
 (0)