cookiecutter-django
cookiecutter-django copied to clipboard
Improve pre gen project.py
Function Extraction: I created separate functions (check_project_slug, check_author_name, etc.) to encapsulate specific checks. This makes the code more modular and readable.
Function Parameters: I modified the functions to take parameters instead of using global variables directly. This enhances reusability and makes the functions more flexible.
Input Function: I replaced raw_input() with input() to ensure compatibility with both Python 2 and 3, as the input() function serves the same purpose in Python 3.
Encapsulation of Main Checks: The main logic for checking project_slug, author_name, Python version, Whitenoise, and mail service is now encapsulated within the main block. This improves code organization and readability.
Readability and Clarity: Variable names are more descriptive, improving the readability of the code.
Consistent Formatting: I ensured consistent formatting and adhered to PEP 8 conventions for better style and consistency.
Reviewed
What do you mean with this? Can you look into the failing tests?
In general I like your changes to hooks/pre_gen_project.py. I would like to go one step further and remove the whole python 2 code block.
Your changes to tests/test_hooks.py are of little value and, in my opinion, not worth cluttering the git history.
Also I would like to see a single commit for a change like this but we can always squash the commits when merging.