2121import logging
2222import re
2323
24- from typing import Optional , AnyStr , Any , Dict , List
24+ from typing import Optional , Any , Dict , List
2525
2626from github .Issue import Issue
2727from github .PullRequest import PullRequest
@@ -158,7 +158,8 @@ def get_rls_notes(self, line_marks: Optional[list[str]] = None) -> str:
158158 if pull .body and detection_regex .search (pull .body ):
159159 release_notes += self .__get_rls_notes_default (pull , line_marks , detection_regex )
160160 elif pull .body and cr_active and cr_detection_regex .search (pull .body ): # type: ignore[union-attr]
161- release_notes += self .__get_rls_notes_code_rabbit (pull , line_marks , cr_detection_regex ) # type: ignore[arg-type]
161+ release_notes += self .__get_rls_notes_code_rabbit (pull , line_marks ,
162+ cr_detection_regex ) # type: ignore[arg-type]
162163
163164 # Return the concatenated release notes
164165 return release_notes .rstrip ()
@@ -251,7 +252,7 @@ def pulls_count(self) -> int:
251252 @property
252253 def pr_contains_issue_mentions (self ) -> bool :
253254 """Checks if the pull request contains issue mentions."""
254- # todo call both and merge solve in issue
255+ # TODO call both and merge solve in issue #153
255256 return len (extract_issue_numbers_from_body (self ._pulls [0 ])) > 0
256257
257258 @property
@@ -346,8 +347,7 @@ def to_chapter_row(self) -> str:
346347
347348 @return: The record as a row string.
348349 """
349- # TODO - create a version on child classes
350-
350+ # TODO - create a version on child classes #152
351351 self .increment_present_in_chapters ()
352352 row_prefix = f"{ ActionInputs .get_duplicity_icon ()} " if self .present_in_chapters () > 1 else ""
353353 format_values = {}
@@ -429,11 +429,7 @@ def is_commit_sha_present(self, sha: str) -> bool:
429429 @param sha: The commit SHA to check for.
430430 @return: A boolean indicating whether the specified commit SHA is present in the record.
431431 """
432- for pull in self ._pulls :
433- if pull .merge_commit_sha == sha :
434- return True
435-
436- return False
432+ return any (pull .merge_commit_sha == sha for pull in self ._pulls )
437433
438434 @staticmethod
439435 def is_pull_request_merged (pull : PullRequest ) -> bool :
@@ -456,7 +452,7 @@ def __init__(self, pull: PullRequest, skip: bool = False):
456452 super ().__init__ (issue = None , skip = skip )
457453 self .register_pull_request (pull )
458454 self .__is_release_note_detected = self .contains_release_notes
459- self .___issues : Dict [int , List [Issue ]] = {}
455+ self .__issues : Dict [int , List [Issue ]] = {}
460456
461457
462458class IssueRecord (Record ):
0 commit comments