Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Jul 26, 2022
1 parent d01e069 commit 819378a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


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

file_names = ["Dockerfile", "Pipfile", ".github/workflows/test.yml"]
for file_name in file_names:
Expand All @@ -15,8 +15,8 @@ def set_python_version():

def remove_main_if_lib():
is_lib = '{{ cookiecutter.binary }}'
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
if not (is_lib == "y" or is_lib == "Y"):
if is_lib not in {"y", "Y"}:
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
os.remove(main_file_path)
print(main_file_path)

Expand All @@ -28,7 +28,7 @@ def remove_main_if_lib():
def main():
set_python_version()
remove_main_if_lib()
print(SUCCESS + "Project successfully initialized" + TERMINATOR)
print(f"{SUCCESS}Project successfully initialized{TERMINATOR}")


if __name__ == "__main__":
Expand Down

0 comments on commit 819378a

Please sign in to comment.