File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
commitizen/cz/conventional_commits Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class ConventionalCommitsCz(BaseCommitizen):
3838 "refactor" : "Refactor" ,
3939 "perf" : "Perf" ,
4040 }
41+ changelog_pattern = defaults .bump_pattern
4142
4243 def questions (self ) -> Questions :
4344 questions : Questions = [
Original file line number Diff line number Diff line change @@ -872,3 +872,21 @@ def test_changelog_from_rev_latest_version_dry_run(
872872 out , _ = capsys .readouterr ()
873873
874874 file_regression .check (out , extension = ".md" )
875+
876+
877+ @pytest .mark .usefixtures ("tmp_commitizen_project" )
878+ def test_invalid_subject_is_skipped (mocker , capsys ):
879+ """Fix #510"""
880+ non_conformant_commit_title = (
881+ "Merge pull request #487 from manang/master\n \n "
882+ "feat: skip merge messages that start with Pull request\n "
883+ )
884+ create_file_and_commit (non_conformant_commit_title )
885+ create_file_and_commit ("feat: a new world" )
886+ testargs = ["cz" , "changelog" , "--dry-run" ]
887+ mocker .patch .object (sys , "argv" , testargs )
888+ with pytest .raises (DryRunExit ):
889+ cli .main ()
890+ out , _ = capsys .readouterr ()
891+
892+ assert out == ("## Unreleased\n \n ### Feat\n \n - a new world\n \n " )
You can’t perform that action at this time.
0 commit comments