@@ -1346,11 +1346,11 @@ def test_bump_allow_no_commit_with_invalid_custom_bump_map_raises(
13461346 version = "0.1.0"
13471347
13481348 [tool.commitizen.customize]
1349- bump_pattern = "^(new|fix|docs )"
1350- bump_map = { new = "MINORR", fix = "PATCH", docs = "NONE" }
1351- change_type_map = { new = "Features", fix = "Bugs", docs = "Docs" }
1352- changelog_pattern = "^(new|fix|docs )"
1353- commit_parser = '^(?P<change_type>new|fix|docs ):\\ s(?P<message>.+)$'
1349+ bump_pattern = "^(new|fix)"
1350+ bump_map = { new = "MINORR", fix = "PATCH" }
1351+ change_type_map = { new = "Features", fix = "Bugs" }
1352+ changelog_pattern = "^(new|fix)"
1353+ commit_parser = '^(?P<change_type>new|fix):\\ s(?P<message>.+)$'
13541354 schema_pattern = ".*"
13551355 questions = []
13561356 """
@@ -1369,6 +1369,45 @@ def test_bump_allow_no_commit_with_invalid_custom_bump_map_raises(
13691369 assert git .tag_exist ("0.1.2" ) is False
13701370
13711371
1372+
1373+ def test_bump_allow_no_commit_with_string_none_bump_map_raises (
1374+ tmp_commitizen_project : Path ,
1375+ monkeypatch : pytest .MonkeyPatch ,
1376+ util : UtilFixture ,
1377+ ) -> None :
1378+ """A matched bump-map string NONE must fail instead of falling back to PATCH."""
1379+ monkeypatch .chdir (tmp_commitizen_project )
1380+ (tmp_commitizen_project / "pyproject.toml" ).write_text (
1381+ dedent (
1382+ """
1383+ [tool.commitizen]
1384+ name = "cz_customize"
1385+ version = "0.1.0"
1386+
1387+ [tool.commitizen.customize]
1388+ bump_pattern = "^(docs|fix)"
1389+ bump_map = { docs = "NONE", fix = "PATCH" }
1390+ change_type_map = { docs = "Docs", fix = "Bugs" }
1391+ changelog_pattern = "^(docs|fix)"
1392+ commit_parser = '^(?P<change_type>docs|fix):\\ s(?P<message>.+)$'
1393+ schema_pattern = ".*"
1394+ questions = []
1395+ """
1396+ ).strip ()
1397+ + "\n " ,
1398+ encoding = "utf-8" ,
1399+ )
1400+
1401+ util .create_file_and_commit ("fix: seed release" )
1402+ util .run_cli ("bump" , "--yes" )
1403+ util .create_file_and_commit ("docs: update guide" )
1404+
1405+ with pytest .raises (ValueError , match = "NONE" ):
1406+ util .run_cli ("bump" , "--yes" , "--allow-no-commit" )
1407+
1408+ assert git .tag_exist ("0.1.2" ) is False
1409+
1410+
13721411def test_bump_allow_no_commit_with_increment (
13731412 tmp_commitizen_project , monkeypatch , util : UtilFixture , capsys
13741413):
0 commit comments