File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,18 @@ private ClassDef getAProtocolDef() {
128128 )
129129}
130130
131+ predicate is_typing_ellipsis ( ExprStmt s ) {
132+ s .getValue ( ) instanceof Ellipsis and
133+ s .getScope ( ) instanceof Function and
134+ is_only_scope_statement ( s ) and
135+ (
136+ s .getScope ( ) = getAnOverload ( )
137+ or
138+ s .getScope ( ) .getScope ( ) instanceof Class and
139+ s .getScope ( ) .getScope ( ) = getAProtocolDef ( ) .getDefinedClass ( )
140+ )
141+ }
142+
131143predicate is_notebook ( File f ) {
132144 exists ( Comment c | c .getLocation ( ) .getFile ( ) = f |
133145 c .getText ( ) .regexpMatch ( "#\\s*<nbformat>.+</nbformat>\\s*" )
@@ -173,5 +185,5 @@ predicate no_effect(Expr e) {
173185}
174186
175187from ExprStmt stmt
176- where no_effect ( stmt .getValue ( ) )
188+ where no_effect ( stmt .getValue ( ) ) and not is_typing_ellipsis ( stmt )
177189select stmt , "This statement has no effect."
You can’t perform that action at this time.
0 commit comments