Skip to content

Commit d71977f

Browse files
Karanraj-6Copilot
andauthored
Update src/uipath_mcp/_cli/_utils/_config.py
The validate_server_name method lacks type hints and docstring. Add parameter and return type annotations, and include a docstring explaining the validation rules. Co-authored-by: Copilot <[email protected]>
1 parent bc0c613 commit d71977f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/uipath_mcp/_cli/_utils/_config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ def exists(self) -> bool:
5252
return os.path.exists(self.config_path)
5353

5454
@staticmethod
55-
def validate_server_name(name):
55+
def validate_server_name(name: str) -> None:
56+
"""
57+
Validate the server name.
58+
59+
The server name must only contain letters (a-z, A-Z), numbers (0-9), and hyphens (-).
60+
Raises a ValueError if the name is invalid.
61+
"""
5662
if not re.match(r'^[a-zA-Z0-9-]+$', name):
5763
raise ValueError(f'Invalid server name "{name}": only letters, numbers, and hyphens are allowed.')
5864

0 commit comments

Comments
 (0)