mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
AlertSuppression: allow //lgtm comments to scope over the next line
This commit is contained in:
@@ -8,20 +8,22 @@
|
||||
private import codeql.suppression.AlertSuppression as AS
|
||||
private import codeql.ruby.ast.internal.TreeSitter
|
||||
|
||||
class SingleLineComment extends Ruby::Comment {
|
||||
SingleLineComment() {
|
||||
// suppression comments must be single-line
|
||||
this.getLocation().getStartLine() = this.getLocation().getEndLine()
|
||||
}
|
||||
|
||||
class AstNode extends Ruby::Token {
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
}
|
||||
|
||||
class SingleLineComment extends Ruby::Comment, AstNode {
|
||||
SingleLineComment() {
|
||||
// suppression comments must be single-line
|
||||
this.getLocation().getStartLine() = this.getLocation().getEndLine()
|
||||
}
|
||||
|
||||
/** Gets the suppression annotation in this comment. */
|
||||
string getText() { result = this.getValue().suffix(1) }
|
||||
}
|
||||
|
||||
import AS::Make<SingleLineComment>
|
||||
import AS::Make<AstNode, SingleLineComment>
|
||||
|
||||
Reference in New Issue
Block a user