mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #10723 from tamasvajk/kotlin-generated-files
Kotlin: Recognize generated files
This commit is contained in:
@@ -51,9 +51,9 @@ library class MarkerCommentGeneratedFile extends GeneratedFile {
|
||||
/**
|
||||
* A marker comment that indicates that it is in a generated file.
|
||||
*/
|
||||
private class GeneratedFileMarker extends Top instanceof JavadocElement {
|
||||
private class GeneratedFileMarker extends Top {
|
||||
GeneratedFileMarker() {
|
||||
exists(string msg | msg = this.getText() |
|
||||
exists(string msg | msg = this.(JavadocElement).getText() or msg = this.(KtComment).getText() |
|
||||
msg.regexpMatch("(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*") or
|
||||
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*") or
|
||||
msg.regexpMatch("(?i).*\\bAny modifications to this file will be lost\\b.*") or
|
||||
|
||||
Reference in New Issue
Block a user