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:
Anders Schack-Mulligen
2020-01-10 11:05:23 +01:00
committed by GitHub
5 changed files with 40 additions and 1 deletions

View File

@@ -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*\\[[^\\]]*\\]", _, _)