Skip to content

Commit 27c30ab

Browse files
committed
Fix comment issue
1 parent 3a5c436 commit 27c30ab

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/utils/git/code-lint-helper.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@ def create_comment_text(warning: str, cpp_files: List[str]) -> str:
141141

142142

143143
def find_comment(pr: any, args: LintArgs) -> any:
144-
comment_tag = get_comment_tag(args.linter)
144+
linter_tag = get_comment_tag(args.linter)
145+
other_linter = "doc8" if args.linter == "clang-tidy" else "clang-tidy"
146+
other_tag = get_comment_tag(other_linter)
147+
145148
for comment in pr.as_issue().get_comments():
146-
if comment_tag in comment.body:
149+
body = comment.body
150+
if linter_tag in body and other_tag not in body:
151+
# Found a comment that is exclusively for this linter.
147152
return comment
148153
return None
149154

@@ -230,7 +235,6 @@ def run_clang_tidy(changed_files: List[str], args: LintArgs) -> Optional[str]:
230235
return clean_clang_tidy_output(proc.stdout.strip())
231236

232237

233-
234238
def clean_doc8_output(output: str) -> Optional[str]:
235239
if not output:
236240
return None

0 commit comments

Comments
 (0)