Python: Broaden noqa regex

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-08-30 11:55:30 +02:00
parent d900c3d994
commit 98301332bd

View File

@@ -72,7 +72,7 @@ class LgtmSuppressionComment extends LineSuppressionComment {
* A noqa suppression comment. Both pylint and pyflakes respect this, so lgtm ought to too.
*/
class NoqaSuppressionComment extends LineSuppressionComment {
NoqaSuppressionComment() { this.getContents().toLowerCase().regexpMatch("\\s*noqa\\s*") }
NoqaSuppressionComment() { this.getContents().toLowerCase().regexpMatch("\\s*noqa([^:].*)?") }
override string getAnnotation() { result = "lgtm" }
}