@@ -140,18 +140,18 @@ class TestMapViolationTextToRuleId:
140140 @pytest .mark .parametrize (
141141 "text,expected_rule_id" ,
142142 [
143- ("Pull request does not have the minimum required approvals " , RuleID .MIN_PR_APPROVALS ),
144- ("Pull request is missing required label : security" , RuleID .REQUIRED_LABELS ),
145- ("Pull request title does not match the required pattern" , RuleID .PR_TITLE_PATTERN ),
146- ("Pull request description is too short (20 chars) " , RuleID .PR_DESCRIPTION_REQUIRED ),
147- ("Individual files cannot exceed 10MB limit" , RuleID .FILE_SIZE_LIMIT ),
143+ ("PR has 1 approvals, requires 2 " , RuleID .MIN_PR_APPROVALS ),
144+ ("Missing required labels : security" , RuleID .REQUIRED_LABELS ),
145+ ("PR title 'foo' does not match required pattern '^feat' " , RuleID .PR_TITLE_PATTERN ),
146+ ("PR description is too short" , RuleID .PR_DESCRIPTION_REQUIRED ),
147+ ("Files exceed size limit of 10MB " , RuleID .FILE_SIZE_LIMIT ),
148148 ("Pull request exceeds maximum lines changed (1234 > 500)" , RuleID .MAX_PR_LOC ),
149149 (
150150 "PR does not reference a linked issue (e.g. #123 or closes #123 in body/title)" ,
151151 RuleID .REQUIRE_LINKED_ISSUE ,
152152 ),
153- ("Force pushes are not allowed on this branch" , RuleID .NO_FORCE_PUSH ),
154- ("Direct pushes to main/master branches prohibited " , RuleID .PROTECTED_BRANCH_PUSH ),
153+ ("Force push detected on protected branch" , RuleID .NO_FORCE_PUSH ),
154+ ("PR targets protected branch 'main' " , RuleID .PROTECTED_BRANCH_PUSH ),
155155 ("Paths without a code owner in CODEOWNERS: src/bar.py" , RuleID .PATH_HAS_CODE_OWNER ),
156156 (
157157 "Code owners for modified paths must be added as reviewers: alice" ,
@@ -175,7 +175,7 @@ class TestMapViolationTextToRuleDescription:
175175
176176 def test_maps_to_description (self ):
177177 """Should map violation text to human-readable description."""
178- text = "Pull request does not have the minimum required approvals "
178+ text = "PR has 1 approvals, requires 2 "
179179 description = map_violation_text_to_rule_description (text )
180180 assert description == "Pull requests require at least 2 approvals"
181181
@@ -193,7 +193,7 @@ def test_parses_single_violation(self):
193193**Reason:** Emergency fix
194194
195195The following violations have been overridden:
196- • Pull request does not have the minimum required approvals
196+ • PR has 1 approvals, requires 2
197197
198198---
199199*This acknowledgment was validated.*"""
@@ -211,8 +211,8 @@ def test_parses_multiple_violations(self):
211211**Reason:** Sprint deadline
212212
213213The following violations have been overridden:
214- • Pull request does not have the minimum required approvals
215- • Pull request is missing required label : review
214+ • PR has 1 approvals, requires 2
215+ • Missing required labels : review
216216
217217---"""
218218
@@ -230,7 +230,7 @@ def test_empty_comment_returns_empty_list(self):
230230 def test_returns_acknowledgment_models (self ):
231231 """Should return proper Acknowledgment model instances."""
232232 comment = """The following violations have been overridden:
233- • Force pushes are not allowed """
233+ • Force push detected on protected branch """
234234
235235 acknowledgments = parse_acknowledgment_comment (comment , "admin" )
236236
@@ -240,7 +240,7 @@ def test_returns_acknowledgment_models(self):
240240 def test_stops_at_section_delimiter (self ):
241241 """Should stop parsing when hitting section delimiters."""
242242 comment = """The following violations have been overridden:
243- • Pull request title does not match the required pattern
243+ • PR title 'foo' does not match required pattern '^feat'
244244---
245245⚠️ Other content that should be ignored
246246• Some other bullet that is NOT a violation"""
0 commit comments