@@ -102,7 +102,7 @@ def test_bump_minor_increment_annotated_config_file(
102
102
):
103
103
tmp_commitizen_cfg_file = tmp_commitizen_project .join ("pyproject.toml" )
104
104
tmp_commitizen_cfg_file .write (
105
- f"{ tmp_commitizen_cfg_file .read ()} \n " f"annotated_tag = 1"
105
+ f"{ tmp_commitizen_cfg_file .read ()} \n annotated_tag = 1"
106
106
)
107
107
create_file_and_commit (commit_msg )
108
108
testargs = ["cz" , "bump" , "--yes" ]
@@ -121,7 +121,7 @@ def test_bump_minor_increment_signed_config_file(
121
121
commit_msg , mocker : MockFixture , tmp_commitizen_project_with_gpg
122
122
):
123
123
tmp_commitizen_cfg_file = tmp_commitizen_project_with_gpg .join ("pyproject.toml" )
124
- tmp_commitizen_cfg_file .write (f"{ tmp_commitizen_cfg_file .read ()} \n " f"gpg_sign = 1" )
124
+ tmp_commitizen_cfg_file .write (f"{ tmp_commitizen_cfg_file .read ()} \n gpg_sign = 1" )
125
125
create_file_and_commit (commit_msg )
126
126
testargs = ["cz" , "bump" , "--yes" ]
127
127
mocker .patch .object (sys , "argv" , testargs )
@@ -383,7 +383,7 @@ def test_bump_on_git_with_hooks_no_verify_disabled(mocker: MockFixture):
383
383
"""Bump commit without --no-verify"""
384
384
cmd .run ("mkdir .git/hooks" )
385
385
with open (".git/hooks/pre-commit" , "w" , encoding = "utf-8" ) as f :
386
- f .write (" #!/usr/bin/env bash\n " 'echo "0.1.0"' )
386
+ f .write (' #!/usr/bin/env bash\n echo "0.1.0"' )
387
387
cmd .run ("chmod +x .git/hooks/pre-commit" )
388
388
389
389
# MINOR
@@ -402,7 +402,7 @@ def test_bump_on_git_with_hooks_no_verify_disabled(mocker: MockFixture):
402
402
def test_bump_tag_exists_raises_exception (mocker : MockFixture ):
403
403
cmd .run ("mkdir .git/hooks" )
404
404
with open (".git/hooks/post-commit" , "w" , encoding = "utf-8" ) as f :
405
- f .write ("#!/usr/bin/env bash\n " "exit 9" )
405
+ f .write ("#!/usr/bin/env bash\n exit 9" )
406
406
cmd .run ("chmod +x .git/hooks/post-commit" )
407
407
408
408
# MINOR
@@ -421,7 +421,7 @@ def test_bump_tag_exists_raises_exception(mocker: MockFixture):
421
421
def test_bump_on_git_with_hooks_no_verify_enabled (mocker : MockFixture ):
422
422
cmd .run ("mkdir .git/hooks" )
423
423
with open (".git/hooks/pre-commit" , "w" , encoding = "utf-8" ) as f :
424
- f .write (" #!/usr/bin/env bash\n " 'echo "0.1.0"' )
424
+ f .write (' #!/usr/bin/env bash\n echo "0.1.0"' )
425
425
cmd .run ("chmod +x .git/hooks/pre-commit" )
426
426
427
427
# MINOR
@@ -478,7 +478,7 @@ def test_bump_when_no_new_commit(mocker: MockFixture):
478
478
with pytest .raises (NoCommitsFoundError ) as excinfo :
479
479
cli .main ()
480
480
481
- expected_error_message = "[NO_COMMITS_FOUND]\n " "No new commits found."
481
+ expected_error_message = "[NO_COMMITS_FOUND]\n No new commits found."
482
482
assert expected_error_message in str (excinfo .value )
483
483
484
484
@@ -710,7 +710,7 @@ def test_prevent_prerelease_when_no_increment_detected(mocker: MockFixture, caps
710
710
cli .main ()
711
711
712
712
expected_error_message = (
713
- "[NO_COMMITS_FOUND]\n " "No commits found to generate a pre-release."
713
+ "[NO_COMMITS_FOUND]\n No commits found to generate a pre-release."
714
714
)
715
715
assert expected_error_message in str (excinfo .value )
716
716
@@ -862,7 +862,7 @@ def test_bump_changelog_command_commits_untracked_changelog_and_version_files(
862
862
mode = "a" ,
863
863
encoding = "utf-8" ,
864
864
) as commitizen_config :
865
- commitizen_config .write (f"version_files = [\n " f" '{ version_regex } '\n ]" )
865
+ commitizen_config .write (f"version_files = [\n '{ version_regex } '\n ]" )
866
866
867
867
with tmp_commitizen_project .join (version_filepath ).open (
868
868
mode = "a+" , encoding = "utf-8"
@@ -917,7 +917,7 @@ def test_bump_invalid_manual_version_raises_exception(mocker, manual_version):
917
917
cli .main ()
918
918
919
919
expected_error_message = (
920
- "[INVALID_MANUAL_VERSION]\n " f"Invalid manual version: '{ manual_version } '"
920
+ f "[INVALID_MANUAL_VERSION]\n Invalid manual version: '{ manual_version } '"
921
921
)
922
922
assert expected_error_message in str (excinfo .value )
923
923
@@ -1425,7 +1425,7 @@ def test_bump_changelog_contains_increment_only(mocker, tmp_commitizen_project,
1425
1425
project_root = Path (tmp_commitizen_project )
1426
1426
tmp_commitizen_cfg_file = project_root / "pyproject.toml"
1427
1427
tmp_commitizen_cfg_file .write_text (
1428
- " [tool.commitizen]\n " 'version ="1.0.0"\n ' "update_changelog_on_bump = true\n "
1428
+ ' [tool.commitizen]\n version ="1.0.0"\n update_changelog_on_bump = true\n '
1429
1429
)
1430
1430
tmp_changelog_file = project_root / "CHANGELOG.md"
1431
1431
tmp_changelog_file .write_text ("## v1.0.0" )
0 commit comments