Skip to content

Commit 8cede4c

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent 123c991 commit 8cede4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hooks/post_gen_project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
repo_name = '{{cookiecutter.repo_name }}'
55

66
def set_python_version():
7-
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
7+
python_version = f"{str(sys.version_info.major)}.{str(sys.version_info.minor)}"
88

99
file_names = ["Dockerfile", "Pipfile", ".github/workflows/test.yml"]
1010
for file_name in file_names:
@@ -16,8 +16,8 @@ def set_python_version():
1616

1717
def remove_main_if_lib():
1818
is_lib = '{{ cookiecutter.binary }}'
19-
main_file_path = os.path.join(repo_name, '__main__.py')
20-
if not (is_lib == "y" or is_lib == "Y"):
19+
if is_lib not in {"y", "Y"}:
20+
main_file_path = os.path.join(repo_name, '__main__.py')
2121
os.remove(main_file_path)
2222

2323
SUCCESS = "\x1b[1;32m"
@@ -28,7 +28,7 @@ def remove_main_if_lib():
2828
def main():
2929
set_python_version()
3030
remove_main_if_lib()
31-
print(SUCCESS + "Project successfully initialized" + TERMINATOR)
31+
print(f"{SUCCESS}Project successfully initialized{TERMINATOR}")
3232

3333

3434
if __name__ == "__main__":

0 commit comments

Comments
 (0)