Skip to content

Commit 145ac3e

Browse files
committed
Dangerfile: warn about too many commits.
Addressed to #537
1 parent 565d439 commit 145ac3e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: Dangerfile

+10
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,16 @@ else
668668
end
669669
end
670670

671+
commits = git.commits.size
672+
if commits > 1
673+
warn(
674+
"danger check: pull request contains #{commits} commits while most of the cases it should have only one.\n"\
675+
"If it's not a special case you should squash commits into single one.\n"\
676+
"You can read how to do it here: https://davidwalsh.name/squash-commits-git\n"\
677+
"But be careful because **it can destroy** all your changes!"
678+
)
679+
end
680+
671681
all_checks_passed = violation_report[:errors].empty? && violation_report[:warnings].empty? && violation_report[:messages].empty?
672682
if all_checks_passed
673683
message(

0 commit comments

Comments
 (0)