Skip to content

Commit cf7a16d

Browse files
Template setup: More aggressive user input stripping (#109)
* Template setup: More aggressive user input stripping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8e179de commit cf7a16d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

setup_template.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,24 @@ def main() -> None:
2929
.read()
3030
.split("/")[-1]
3131
.split(".")[0]
32+
.strip()
3233
)
3334

3435
# Ask for some data
3536
if git_uncommitted_changes:
3637
print("You have uncommitted changes. Please commit or stash them first.")
3738
exit(1)
3839
repo_name = (
39-
input(f"Enter the name of the repository [{git_repo_name}]: ") or git_repo_name
40+
input(f"Enter the name of the repository [{git_repo_name}]: ").strip()
41+
or git_repo_name
4042
)
41-
module_name = input(f"Enter the name of the module [{repo_name}]: ") or repo_name
42-
username = input(f"Enter your username [{git_username}]: ") or git_username
43-
email = input(f"Enter your email [{git_email}]: ") or git_email
43+
module_name = (
44+
input(f"Enter the name of the module [{repo_name}]: ").strip() or repo_name
45+
)
46+
username = input(f"Enter your username [{git_username}]: ").strip() or git_username
47+
email = input(f"Enter your email [{git_email}]: ").strip() or git_email
4448
description = (
45-
input("Enter a short description of the project: ")
49+
input("Enter a short description of the project: ").strip()
4650
or "A beautiful description."
4751
)
4852
repo_license = licenses.request_license()

0 commit comments

Comments
 (0)