-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add check missing permissions + docstring
- Loading branch information
1 parent
d16dc83
commit bfb0722
Showing
3 changed files
with
112 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def limit_string_length(input_string: str, max_length: int) -> str: | ||
""" | ||
Limit the length of a string. | ||
Parameters: | ||
input_string (str): The input string. | ||
max_length (int): The maximum length. | ||
Returns: | ||
str: The limited string. | ||
""" | ||
if len(input_string) > max_length: | ||
input_string = input_string[: max_length - 3] + "..." | ||
return input_string |