Skip to content

Commit

Permalink
Run docfromatter
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Apr 10, 2024
1 parent cbd0159 commit 7367836
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/py/flwr/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ def prompt_options(text: str, options: List[str]) -> str:


def is_valid_project_name(name: str) -> bool:
"""
Check if the given string is a valid Python module name.
"""Check if the given string is a valid Python module name.
A valid module name must start with a letter or an underscore,
and can only contain letters, digits, and underscores.
A valid module name must start with a letter or an underscore, and can only contain
letters, digits, and underscores.
"""

if not name:
Expand All @@ -96,11 +95,11 @@ def is_valid_project_name(name: str) -> bool:


def sanitize_project_name(name: str) -> str:
"""
Sanitize the given string to make it a valid Python module name.
This version replaces hyphens with underscores, removes any characters
not allowed in Python module names, makes the string lowercase, and
ensures it starts with a valid character.
"""Sanitize the given string to make it a valid Python module name.
This version replaces hyphens with underscores, removes any characters not allowed
in Python module names, makes the string lowercase, and ensures it starts with a
valid character.
"""
# Replace '-' with '_'
name_with_underscores = name.replace("-", "_").replace(" ", "_")
Expand Down

0 comments on commit 7367836

Please sign in to comment.