diff --git a/ci_dir.py b/ci_dir.py index 93b3d3d..b3a53d9 100755 --- a/ci_dir.py +++ b/ci_dir.py @@ -21,10 +21,10 @@ cwd_bn = cwd.name # add './' prefix to cwd_bn -rel = "./" + cwd_bn +rel = f"./{cwd_bn}" # add 'CWD=' prefix to rel -cwd_str = "CWD=" + rel +cwd_str = f"CWD={rel}" # call git via subprocess to find name of repo abs = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip() diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 444f732..8e9eb90 100755 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -7,7 +7,9 @@ module_name = "{{ cookiecutter.project_slug}}" if not re.match(MODULE_REGEX, module_name): - print("ERROR: The project slug (%s) is not a valid Python module name. Please do not use a - and use _ instead" % module_name) + print( + f"ERROR: The project slug ({module_name}) is not a valid Python module name. Please do not use a - and use _ instead" + ) # Exit to cancel project sys.exit(1) diff --git a/tests/test_bake_project.py b/tests/test_bake_project.py index a3a7851..f6e8a92 100755 --- a/tests/test_bake_project.py +++ b/tests/test_bake_project.py @@ -89,7 +89,7 @@ def test_bake_and_run_tests(cookies): with bake_in_temp_dir(cookies) as result: assert result.project.isdir() run_inside_dir("python setup.py test", str(result.project)) == 0 - print("test_bake_and_run_tests path", str(result.project)) + print("test_bake_and_run_tests path", result.project) def test_bake_withspecialchars_and_run_tests(cookies): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py index 7cbc1e4..3835005 100755 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py @@ -24,7 +24,7 @@ def main(): parser.add_argument('_', nargs='*') args = parser.parse_args() - print("Arguments: " + str(args._)) + print(f"Arguments: {str(args._)}") print("Replace this message by putting your code into " "{{cookiecutter.project_slug}}.cli.main") return 0