File tree Expand file tree Collapse file tree
src/experimental/semmle/python/frameworks
test/experimental/library-tests/frameworks/fabric Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,5 +357,42 @@ private module FabricV2 {
357357 result .asCfgNode ( ) = [ node .getArg ( 0 ) , node .getArgByName ( "command" ) ]
358358 }
359359 }
360+
361+ // -------------------------------------------------------------------------
362+ // fabric.tasks
363+ // -------------------------------------------------------------------------
364+ /** Gets a reference to the `fabric.tasks` module. */
365+ DataFlow:: Node tasks ( ) { result = fabric_attr ( "tasks" ) }
366+
367+ /** Provides models for the `fabric.tasks` module */
368+ module tasks {
369+ /** Gets a reference to the `fabric.tasks.task` decorator. */
370+ private DataFlow:: Node task ( DataFlow:: TypeTracker t ) {
371+ t .start ( ) and
372+ result = DataFlow:: importNode ( "fabric.tasks.task" )
373+ or
374+ t .startInAttr ( "task" ) and
375+ result = tasks ( )
376+ or
377+ // Handle `fabric.task` alias
378+ t .startInAttr ( "task" ) and
379+ result = fabric ( )
380+ or
381+ exists ( DataFlow:: TypeTracker t2 | result = task ( t2 ) .track ( t2 , t ) )
382+ }
383+
384+ /** Gets a reference to the `fabric.tasks.task` decorator. */
385+ DataFlow:: Node task ( ) { result = task ( DataFlow:: TypeTracker:: end ( ) ) }
386+ }
387+
388+ class FabricTaskFirstParamConnectionInstance extends fabric:: connection:: Connection:: InstanceSource ,
389+ DataFlow:: ParameterNode {
390+ FabricTaskFirstParamConnectionInstance ( ) {
391+ exists ( Function func |
392+ func .getADecorator ( ) = fabric:: tasks:: task ( ) .asExpr ( ) and
393+ this .getParameter ( ) = func .getArg ( 0 )
394+ )
395+ }
396+ }
360397 }
361398}
Original file line number Diff line number Diff line change 44| fabric_v2_test.py:41:69:41:94 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
55| fabric_v2_test.py:44:25:44:50 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
66| fabric_v2_test.py:47:65:47:90 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
7- | fabric_v2_test.py:58:26:58:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
8- | fabric_v2_test.py:64:26:64:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
You can’t perform that action at this time.
0 commit comments