mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge pull request #2607 from yo-h/java-alert-suppression-block-comment
Java: allow single-line `/* ... */` comments for alert suppression
This commit is contained in:
@@ -14,7 +14,12 @@ class SuppressionComment extends Javadoc {
|
||||
string annotation;
|
||||
|
||||
SuppressionComment() {
|
||||
isEolComment(this) and
|
||||
// suppression comments must be single-line
|
||||
(
|
||||
isEolComment(this)
|
||||
or
|
||||
isNormalComment(this) and exists(int line | hasLocationInfo(_, line, _, line, _))
|
||||
) and
|
||||
exists(string text | text = getChild(0).getText() |
|
||||
// match `lgtm[...]` anywhere in the comment
|
||||
annotation = text.regexpFind("(?i)\\blgtm\\s*\\[[^\\]]*\\]", _, _)
|
||||
|
||||
Reference in New Issue
Block a user