Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The check implements the following rules from the CERT C Coding Standard:

`cert-msc24-c` and `cert-msc33-c` redirect here as aliases of this check.


Unsafe functions
----------------

Expand Down
14 changes: 12 additions & 2 deletions llvm/utils/git/code-lint-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,20 @@ def pr_comment_text_for_diff(
</details>
"""

# TODO: Refactor this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the idea behind refactor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that I forgot to remove this line, fixed in the latest commit.

def find_comment(self, pr: any) -> any:
all_linter_names = [l.name for l in ALL_LINTERS]
other_linter_names = [name for name in all_linter_names if name != self.name]

other_tags = [
self.COMMENT_TAG.format(linter=name) for name in other_linter_names
]

for comment in pr.as_issue().get_comments():
if self.comment_tag in comment.body:
return comment
body = comment.body
if self.comment_tag in body:
if not any(other_tag in body for other_tag in other_tags):
return comment
return None

def update_pr(self, comment_text: str, args: LintArgs, create_new: bool) -> None:
Expand Down
Loading