@@ -2778,7 +2778,7 @@ def test_skip_reason_is_shown_on_the_scope_and_under_the_verdict(self):
27782778 body = main .render_report (results )
27792779 self .assertIn (
27802780 "⊘ **All 3 checks skipped** — nothing was validated\n \n "
2781- f "Skipped because { commit } ; { branch } .\n " ,
2781+ "Skipped because author dependabot[bot] is in ignore_authors .\n " ,
27822782 body ,
27832783 )
27842784 self .assertIn (f" ⊘ PR title (skipped: { commit } )" , body )
@@ -2789,7 +2789,8 @@ def test_skip_reason_follows_a_partial_skip_verdict(self):
27892789 results = [pass_scope ("PR title" ), skip_scope ("Branch" , reason = reason )]
27902790 body = main .render_report (results )
27912791 self .assertIn (
2792- f"✅ **1 of 2 checks passed**, 1 skipped\n \n Skipped because { reason } .\n " ,
2792+ "✅ **1 of 2 checks passed**, 1 skipped\n \n "
2793+ "Skipped because author dependabot[bot] is in ignore_authors.\n " ,
27932794 body ,
27942795 )
27952796
@@ -2798,14 +2799,20 @@ def test_skip_reason_reaches_the_step_log(self):
27982799 with patch ("sys.stdout" , new_callable = io .StringIO ) as out :
27992800 main .render_step_log ([skip_scope ("PR title" , reason = reason )])
28002801 self .assertIn (f" ⊘ PR title (skipped: { reason } )" , out .getvalue ())
2801- self .assertIn (f"Skipped because { reason } ." , out .getvalue ())
2802+ self .assertIn (
2803+ "Skipped because author dependabot[bot] is in ignore_authors." ,
2804+ out .getvalue (),
2805+ )
28022806
28032807 def test_skip_reason_follows_a_partial_skip_in_the_step_log (self ):
28042808 reason = "author dependabot[bot] is in [branch].ignore_authors"
28052809 results = [pass_scope ("PR title" ), skip_scope ("Branch" , reason = reason )]
28062810 with patch ("sys.stdout" , new_callable = io .StringIO ) as out :
28072811 main .render_step_log (results )
2808- self .assertIn (f"Skipped because { reason } ." , out .getvalue ())
2812+ self .assertIn (
2813+ "Skipped because author dependabot[bot] is in ignore_authors." ,
2814+ out .getvalue (),
2815+ )
28092816
28102817 def test_a_passing_scope_has_no_skip_reason (self ):
28112818 self .assertEqual (pass_scope ("Branch" , value = "main" ).skip_reason , "" )
@@ -3216,6 +3223,8 @@ def test_step_log_all_skipped_claims_no_pass(self):
32163223 "fix" ,
32173224 "docs_url" ,
32183225}
3226+ #: Keys newer CLIs add on top: ``reason`` says why a check was skipped.
3227+ OPTIONAL_CHECK_KEYS = {"reason" }
32193228STATUSES = {"pass" , "fail" , "warn" , "skip" }
32203229
32213230
@@ -3278,7 +3287,8 @@ def _run(self, message: str) -> tuple[int, dict]:
32783287 self .assertIn ("checks" , data )
32793288 self .assertTrue (data ["checks" ], "CLI reported no checks" )
32803289 for check in data ["checks" ]:
3281- self .assertEqual (set (check ), CHECK_KEYS , check )
3290+ self .assertLessEqual (CHECK_KEYS , set (check ), check )
3291+ self .assertLessEqual (set (check ), CHECK_KEYS | OPTIONAL_CHECK_KEYS , check )
32823292 self .assertIn (check ["status" ], STATUSES , check )
32833293 self .assertRegex (check ["rule_id" ], r"^CC\d{3}$" )
32843294 self .assertTrue (
0 commit comments