From c41ba5f04d5f3c4b29529674215467f4824bb620 Mon Sep 17 00:00:00 2001 From: Colton Pierson Date: Thu, 11 Jul 2024 12:58:35 -0700 Subject: [PATCH] fix flake in static analysis test --- ...oration_referring_to_another_function.snap | 15 +++- ...se__tests__ch_function_with_arguments.snap | 10 ++- ...ts__ch_reference_internal_to_function.snap | 22 ++++-- ...sts__function_decorator_ch_annotation.snap | 20 ++++-- ..._annotation_with_internal_ch_and_emit.snap | 30 ++++++-- ...s__handling_react_hook_style_refrence.snap | 35 ++++++++-- ...thing_extracted_with_no_ch_references.snap | 15 +++- ...rse__tests__pipe_function_composition.snap | 25 +++++-- ...__tests__report_for_simple_function-2.snap | 1 + ...se__tests__report_for_simple_function.snap | 10 ++- ...pt__parse__tests__report_generation-2.snap | 1 + ...ript__parse__tests__report_generation.snap | 30 ++++++-- ..._tests__report_generation_with_import.snap | 35 ++++++++-- .../src/language/python/parse.rs | 2 + ...oration_referring_to_another_function.snap | 25 +++++-- ...ts__ch_reference_internal_to_function.snap | 32 +++++++-- ..._parse__tests__classes_are_identified.snap | 20 ++++-- ...ts__for_loop_assignments_are_captured.snap | 70 +++++++++++++++---- ...sts__function_decorator_ch_annotation.snap | 20 ++++-- ..._annotation_with_internal_ch_and_emit.snap | 45 +++++++++--- ...thing_extracted_with_no_ch_references.snap | 15 +++- ...rse__tests__pipe_function_composition.snap | 20 ++++-- ...s__reference_to_undeclared_function-2.snap | 1 + ...thon__parse__tests__report_generation.snap | 40 ++++++++--- ...ration_for_loop_variable_assignment-2.snap | 3 +- ...neration_for_loop_variable_assignment.snap | 70 +++++++++++++++---- ...rt_generation_function_with_arguments.snap | 45 +++++++++--- ...__tests__report_generation_with_class.snap | 20 ++++-- ..._tests__report_generation_with_import.snap | 25 +++++-- 29 files changed, 561 insertions(+), 141 deletions(-) diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_decoration_referring_to_another_function.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_decoration_referring_to_another_function.snap index 724b647..3a86d50 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_decoration_referring_to_another_function.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_decoration_referring_to_another_function.snap @@ -2,12 +2,18 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function setupPipeline(x) {\n ch.p(create_dockerfile)\n return x\n}\n" --- -- - InFunction: setupPipeline +- - InFunction: + - setupPipeline + - start: 1 + end: 71 - Params - IdentifierReferredTo: - x - false -- - InFunction: setupPipeline +- - InFunction: + - setupPipeline + - start: 1 + end: 71 - InCallExpression - Attribute: p - IdentifierReferredTo: @@ -16,7 +22,10 @@ description: "function setupPipeline(x) {\n ch.p(create_dockerfile)\n retu - IdentifierReferredTo: - create_dockerfile - false -- - InFunction: setupPipeline +- - InFunction: + - setupPipeline + - start: 1 + end: 71 - IdentifierReferredTo: - x - true diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_with_arguments.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_with_arguments.snap index bb49c62..bcaa1c4 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_with_arguments.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_function_with_arguments.snap @@ -2,7 +2,10 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function subtract(a, b) {\n return a - b;\n}\n\n// Example usage\nconst v = subtract(x, 5);\n" --- -- - InFunction: subtract +- - InFunction: + - subtract + - start: 1 + end: 46 - Params - IdentifierReferredTo: - a @@ -10,7 +13,10 @@ description: "function subtract(a, b) {\n return a - b;\n}\n\n// Example usag - IdentifierReferredTo: - b - false -- - InFunction: subtract +- - InFunction: + - subtract + - start: 1 + end: 46 - IdentifierReferredTo: - a - true diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_reference_internal_to_function.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_reference_internal_to_function.snap index 6a8da2d..6a0ec08 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_reference_internal_to_function.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__ch_reference_internal_to_function.snap @@ -1,13 +1,19 @@ --- source: chidori-static-analysis/src/language/javascript/parse.rs -expression: context_stack_references +description: "function evaluate_agent(ev) {\n ch.set(\"file_path\", ev.file_path)\n migration_agent()\n}\n" --- -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 1 + end: 92 - Params - IdentifierReferredTo: - ev - false -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 1 + end: 92 - InCallExpression - Attribute: set - IdentifierReferredTo: @@ -18,9 +24,15 @@ expression: context_stack_references - IdentifierReferredTo: - ev - true -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 1 + end: 92 - InCallExpression - IdentifierReferredTo: - migration_agent - false -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 1 + end: 92 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation.snap index 8fa27b3..d2e0d0d 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation.snap @@ -2,19 +2,31 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function migrationAgent() {\n ch.register();\n ch.set(\"bar\", 1);\n}\n" --- -- - InFunction: migrationAgent +- - InFunction: + - migrationAgent + - start: 1 + end: 71 - Params -- - InFunction: migrationAgent +- - InFunction: + - migrationAgent + - start: 1 + end: 71 - InCallExpression - Attribute: register - IdentifierReferredTo: - ch - false -- - InFunction: migrationAgent +- - InFunction: + - migrationAgent + - start: 1 + end: 71 - InCallExpression - Attribute: set - IdentifierReferredTo: - ch - false - Constant: bar -- - InFunction: migrationAgent +- - InFunction: + - migrationAgent + - start: 1 + end: 71 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap index b1ea9f6..fce4b93 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap @@ -2,26 +2,38 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function dispatch_agent(ev) {\n ch.onEvent(\"new_file\")\n ch.emitAs(\"file_created\")\n ch.emitAs(\"file_created\", \"multiple\", \"args\")\n ch.set(\"file_path\", ev.file_path)\n}\n" --- -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 - Params - IdentifierReferredTo: - ev - false -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 - InCallExpression - Attribute: onEvent - IdentifierReferredTo: - ch - false - Constant: new_file -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 - InCallExpression - Attribute: emitAs - IdentifierReferredTo: - ch - false - Constant: file_created -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 - InCallExpression - Attribute: emitAs - IdentifierReferredTo: @@ -30,7 +42,10 @@ description: "function dispatch_agent(ev) {\n ch.onEvent(\"new_file\")\n c - Constant: file_created - Constant: multiple - Constant: args -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 - InCallExpression - Attribute: set - IdentifierReferredTo: @@ -41,4 +56,7 @@ description: "function dispatch_agent(ev) {\n ch.onEvent(\"new_file\")\n c - IdentifierReferredTo: - ev - true -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 1 + end: 177 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__handling_react_hook_style_refrence.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__handling_react_hook_style_refrence.snap index c28c7e5..006437d 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__handling_react_hook_style_refrence.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__handling_react_hook_style_refrence.snap @@ -2,16 +2,25 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function createDockerfile() {\n useHook(() => {\n ch.prompt(\"demo\");\n }, [otherFunction]);\n return prompt(\"prompts/create_dockerfile\")\n}\n" --- -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - Params -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - InCallExpression - IdentifierReferredTo: - useHook - false - InAnonFunction - Params -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - InCallExpression - IdentifierReferredTo: - useHook @@ -23,21 +32,33 @@ description: "function createDockerfile() {\n useHook(() => {\n ch.prom - ch - false - Constant: demo -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - InCallExpression - IdentifierReferredTo: - useHook - false - InAnonFunction -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - InCallExpression - IdentifierReferredTo: - useHook - false -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 - InCallExpression - IdentifierReferredTo: - prompt - false - Constant: prompts/create_dockerfile -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 150 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__nothing_extracted_with_no_ch_references.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__nothing_extracted_with_no_ch_references.snap index 88605fd..a6d5c67 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__nothing_extracted_with_no_ch_references.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__nothing_extracted_with_no_ch_references.snap @@ -2,12 +2,21 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function createDockerfile() {\n return prompt(\"prompts/create_dockerfile\")\n}\n" --- -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 79 - Params -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 79 - InCallExpression - IdentifierReferredTo: - prompt - false - Constant: prompts/create_dockerfile -- - InFunction: createDockerfile +- - InFunction: + - createDockerfile + - start: 1 + end: 79 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__pipe_function_composition.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__pipe_function_composition.snap index fd2125a..4d7c512 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__pipe_function_composition.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__pipe_function_composition.snap @@ -2,21 +2,36 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function main() {\n bar() | foo() | baz()\n}\n" --- -- - InFunction: main +- - InFunction: + - main + - start: 1 + end: 46 - Params -- - InFunction: main +- - InFunction: + - main + - start: 1 + end: 46 - InCallExpression - IdentifierReferredTo: - bar - false -- - InFunction: main +- - InFunction: + - main + - start: 1 + end: 46 - InCallExpression - IdentifierReferredTo: - foo - false -- - InFunction: main +- - InFunction: + - main + - start: 1 + end: 46 - InCallExpression - IdentifierReferredTo: - baz - false -- - InFunction: main +- - InFunction: + - main + - start: 1 + end: 46 diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function-2.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function-2.snap index e1a9f69..a89c173 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function-2.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function-2.snap @@ -2,6 +2,7 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function testing(x) {\n return x\n}\n " --- +internal_call_graph: {} cell_exposed_values: {} cell_depended_values: {} triggerable_functions: diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function.snap index 4102c2a..8c46f35 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_for_simple_function.snap @@ -2,12 +2,18 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function testing(x) {\n return x\n}\n " --- -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 37 - Params - IdentifierReferredTo: - x - false -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 37 - IdentifierReferredTo: - x - true diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation-2.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation-2.snap index 1de4525..136cddf 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation-2.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation-2.snap @@ -2,6 +2,7 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function testing() {\n ch.onEvent(\"new_file\");\n ch.emitAs(\"file_created\");\n const x = 2 + y;\n return x\n}\n " --- +internal_call_graph: {} cell_exposed_values: {} cell_depended_values: y: {} diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation.snap index 2bde256..76450f7 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation.snap @@ -2,33 +2,51 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "function testing() {\n ch.onEvent(\"new_file\");\n ch.emitAs(\"file_created\");\n const x = 2 + y;\n return x\n}\n " --- -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - Params -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - InCallExpression - Attribute: onEvent - IdentifierReferredTo: - ch - false - Constant: new_file -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - InCallExpression - Attribute: emitAs - IdentifierReferredTo: - ch - false - Constant: file_created -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - AssignmentToStatement - IdentifierReferredTo: - x - false -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - AssignmentFromStatement - IdentifierReferredTo: - y - false -- - InFunction: testing +- - InFunction: + - testing + - start: 1 + end: 116 - IdentifierReferredTo: - x - true diff --git a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation_with_import.snap b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation_with_import.snap index ba824e8..673b7ad 100644 --- a/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation_with_import.snap +++ b/toolchain/chidori-static-analysis/src/language/javascript/snapshots/chidori_static_analysis__language__javascript__parse__tests__report_generation_with_import.snap @@ -2,29 +2,50 @@ source: chidori-static-analysis/src/language/javascript/parse.rs description: "import { random } from \"random\"\n\nfunction fun_name() {\n const w = function_that_doesnt_exist()\n const v = 5\n return v\n}\n\nx = random.randint(0, 10)" --- -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - Params -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - AssignmentToStatement - IdentifierReferredTo: - w - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - AssignmentFromStatement - InCallExpression - IdentifierReferredTo: - function_that_doesnt_exist - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - AssignmentFromStatement -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - AssignmentToStatement - IdentifierReferredTo: - v - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - AssignmentFromStatement -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 34 + end: 129 - IdentifierReferredTo: - v - true diff --git a/toolchain/chidori-static-analysis/src/language/python/parse.rs b/toolchain/chidori-static-analysis/src/language/python/parse.rs index b970022..a765433 100644 --- a/toolchain/chidori-static-analysis/src/language/python/parse.rs +++ b/toolchain/chidori-static-analysis/src/language/python/parse.rs @@ -1188,6 +1188,7 @@ x = random.randint(0, 10) "#}; let context_stack_references = extract_dependencies_python(python_source).map_err(|e| anyhow::Error::msg(format!("{:?}", e)))?; insta::with_settings!({ + sort_maps => true, description => python_source, omit_expression => true }, { @@ -1196,6 +1197,7 @@ x = random.randint(0, 10) let result = build_report(&context_stack_references); insta::with_settings!({ + sort_maps => true, description => python_source, omit_expression => true }, { diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_function_decoration_referring_to_another_function.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_function_decoration_referring_to_another_function.snap index 21fcf5f..8259471 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_function_decoration_referring_to_another_function.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_function_decoration_referring_to_another_function.snap @@ -2,26 +2,41 @@ source: chidori-static-analysis/src/language/python/parse.rs expression: context_stack_references --- -- - InFunction: setup_pipeline -- - InFunction: setup_pipeline +- - InFunction: + - setup_pipeline + - start: 25 + end: 60 +- - InFunction: + - setup_pipeline + - start: 25 + end: 60 - InFunctionDecorator: 0 - InCallExpression - IdentifierReferredTo: - create_dockerfile - false -- - InFunction: setup_pipeline +- - InFunction: + - setup_pipeline + - start: 25 + end: 60 - InFunctionDecorator: 0 - InCallExpression - Attribute: p - IdentifierReferredTo: - ch - false -- - InFunction: setup_pipeline +- - InFunction: + - setup_pipeline + - start: 25 + end: 60 - FunctionArguments - IdentifierReferredTo: - x - false -- - InFunction: setup_pipeline +- - InFunction: + - setup_pipeline + - start: 25 + end: 60 - IdentifierReferredTo: - x - true diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_reference_internal_to_function.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_reference_internal_to_function.snap index 2ba0d94..524065d 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_reference_internal_to_function.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__ch_reference_internal_to_function.snap @@ -1,31 +1,49 @@ --- source: chidori-static-analysis/src/language/python/parse.rs -expression: context_stack_references +description: "def evaluate_agent(ev):\n ch.set(\"file_path\", ev.file_path)\n migration_agent()\n" --- -- - InFunction: evaluate_agent -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 - FunctionArguments - IdentifierReferredTo: - ev - false -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 - InCallExpression - Constant: file_path -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 - InCallExpression - Constant: file_path - Attribute: file_path - IdentifierReferredTo: - ev - true -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 - InCallExpression - Constant: file_path - Attribute: set - IdentifierReferredTo: - ch - false -- - InFunction: evaluate_agent +- - InFunction: + - evaluate_agent + - start: 0 + end: 83 - InCallExpression - IdentifierReferredTo: - migration_agent diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__classes_are_identified.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__classes_are_identified.snap index 1bfe89e..c823f8d 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__classes_are_identified.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__classes_are_identified.snap @@ -4,22 +4,34 @@ description: "import unittest\n\nclass TestMarshalledValues(unittest.TestCase):\ --- - - InClass: TestMarshalledValues - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - FunctionArguments - IdentifierReferredTo: - self - false - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - InCallExpression - InCallExpression - IdentifierReferredTo: - addTwo - false - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - InCallExpression - Attribute: assertEqual - IdentifierReferredTo: diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__for_loop_assignments_are_captured.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__for_loop_assignments_are_captured.snap index 5978bed..ed65fa6 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__for_loop_assignments_are_captured.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__for_loop_assignments_are_captured.snap @@ -2,33 +2,57 @@ source: chidori-static-analysis/src/language/python/parse.rs expression: context_stack_references --- -- - InFunction: run_prompt -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 +- - InFunction: + - run_prompt + - start: 0 + end: 202 - FunctionArguments - IdentifierReferredTo: - number_of_states - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentToStatement - IdentifierReferredTo: - out - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentFromStatement - Constant: "" -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentToStatement - IdentifierReferredTo: - state - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - IdentifierReferredTo: - state - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" - Attribute: split @@ -36,7 +60,10 @@ expression: context_stack_references - IdentifierReferredTo: - number_of_states - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" - Attribute: split @@ -44,23 +71,38 @@ expression: context_stack_references - IdentifierReferredTo: - get_states_first_letters - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - IdentifierReferredTo: - out - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - IdentifierReferredTo: - state - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - IdentifierReferredTo: - first_letter - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - Constant: demo -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - Constant: demo - IdentifierReferredTo: - out diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation.snap index e8c4eb6..99ecfaf 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation.snap @@ -2,18 +2,30 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "@ch.register()\ndef migration_agent():\n ch.set(\"bar\", 1)\n" --- -- - InFunction: migration_agent -- - InFunction: migration_agent +- - InFunction: + - migration_agent + - start: 15 + end: 58 +- - InFunction: + - migration_agent + - start: 15 + end: 58 - InFunctionDecorator: 0 - InCallExpression - Attribute: register - IdentifierReferredTo: - ch - false -- - InFunction: migration_agent +- - InFunction: + - migration_agent + - start: 15 + end: 58 - InCallExpression - Constant: bar -- - InFunction: migration_agent +- - InFunction: + - migration_agent + - start: 15 + end: 58 - InCallExpression - Constant: bar - Attribute: set diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap index 29077fc..11dc2e2 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__function_decorator_ch_annotation_with_internal_ch_and_emit.snap @@ -2,12 +2,21 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef dispatch_agent(ev):\n ch.set(\"file_path\", ev.file_path)\n" --- -- - InFunction: dispatch_agent -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InFunctionDecorator: 0 - InCallExpression - Constant: new_file -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InFunctionDecorator: 0 - InCallExpression - Constant: new_file @@ -15,11 +24,17 @@ description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef dis - IdentifierReferredTo: - ch - false -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InFunctionDecorator: 1 - InCallExpression - Constant: file_created -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InFunctionDecorator: 1 - InCallExpression - Constant: file_created @@ -27,22 +42,34 @@ description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef dis - IdentifierReferredTo: - ch - false -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - FunctionArguments - IdentifierReferredTo: - ev - false -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InCallExpression - Constant: file_path -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InCallExpression - Constant: file_path - Attribute: file_path - IdentifierReferredTo: - ev - true -- - InFunction: dispatch_agent +- - InFunction: + - dispatch_agent + - start: 53 + end: 114 - InCallExpression - Constant: file_path - Attribute: set diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__nothing_extracted_with_no_ch_references.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__nothing_extracted_with_no_ch_references.snap index d2d9b5c..9b8e9ed 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__nothing_extracted_with_no_ch_references.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__nothing_extracted_with_no_ch_references.snap @@ -2,11 +2,20 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "def create_dockerfile():\n return prompt(\"prompts/create_dockerfile\")\n" --- -- - InFunction: create_dockerfile -- - InFunction: create_dockerfile +- - InFunction: + - create_dockerfile + - start: 0 + end: 71 +- - InFunction: + - create_dockerfile + - start: 0 + end: 71 - InCallExpression - Constant: prompts/create_dockerfile -- - InFunction: create_dockerfile +- - InFunction: + - create_dockerfile + - start: 0 + end: 71 - InCallExpression - Constant: prompts/create_dockerfile - IdentifierReferredTo: diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__pipe_function_composition.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__pipe_function_composition.snap index 2296d41..699f3bb 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__pipe_function_composition.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__pipe_function_composition.snap @@ -2,18 +2,30 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "def main():\n bar() | foo() | baz()\n" --- -- - InFunction: main -- - InFunction: main +- - InFunction: + - main + - start: 0 + end: 37 +- - InFunction: + - main + - start: 0 + end: 37 - InCallExpression - IdentifierReferredTo: - bar - false -- - InFunction: main +- - InFunction: + - main + - start: 0 + end: 37 - InCallExpression - IdentifierReferredTo: - foo - false -- - InFunction: main +- - InFunction: + - main + - start: 0 + end: 37 - InCallExpression - IdentifierReferredTo: - baz diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__reference_to_undeclared_function-2.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__reference_to_undeclared_function-2.snap index 3a35fb7..d5046c4 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__reference_to_undeclared_function-2.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__reference_to_undeclared_function-2.snap @@ -2,6 +2,7 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "out = await read_file_and_load_to_memory(\"./\")\n" --- +internal_call_graph: {} cell_exposed_values: out: {} cell_depended_values: diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation.snap index ad17950..291c609 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation.snap @@ -2,12 +2,21 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef testing():\n x = 2 + y\n return x\n " --- -- - InFunction: testing -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 +- - InFunction: + - testing + - start: 53 + end: 94 - InFunctionDecorator: 0 - InCallExpression - Constant: new_file -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - InFunctionDecorator: 0 - InCallExpression - Constant: new_file @@ -15,11 +24,17 @@ description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef tes - IdentifierReferredTo: - ch - false -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - InFunctionDecorator: 1 - InCallExpression - Constant: file_created -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - InFunctionDecorator: 1 - InCallExpression - Constant: file_created @@ -27,17 +42,26 @@ description: "@ch.on_event(\"new_file\")\n@ch.emit_as(\"file_created\")\ndef tes - IdentifierReferredTo: - ch - false -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - AssignmentToStatement - IdentifierReferredTo: - x - false -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - AssignmentFromStatement - IdentifierReferredTo: - y - false -- - InFunction: testing +- - InFunction: + - testing + - start: 53 + end: 94 - IdentifierReferredTo: - x - true diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment-2.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment-2.snap index 9d72ca2..f6db1ec 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment-2.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment-2.snap @@ -2,10 +2,11 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "async def run_prompt(number_of_states):\n out = \"\"\n for state in (await get_states_first_letters(num=number_of_states)).split('\\n'):\n out += await first_letter(state)\n return \"demo\" + out\n " --- +internal_call_graph: {} cell_exposed_values: {} cell_depended_values: - get_states_first_letters: {} first_letter: {} + get_states_first_letters: {} triggerable_functions: run_prompt: arguments: diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment.snap index 30962a3..8ad7f1b 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_for_loop_variable_assignment.snap @@ -2,33 +2,57 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "async def run_prompt(number_of_states):\n out = \"\"\n for state in (await get_states_first_letters(num=number_of_states)).split('\\n'):\n out += await first_letter(state)\n return \"demo\" + out\n " --- -- - InFunction: run_prompt -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 +- - InFunction: + - run_prompt + - start: 0 + end: 202 - FunctionArguments - IdentifierReferredTo: - number_of_states - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentToStatement - IdentifierReferredTo: - out - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentFromStatement - Constant: "" -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - AssignmentToStatement - IdentifierReferredTo: - state - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - IdentifierReferredTo: - state - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" - Attribute: split @@ -36,7 +60,10 @@ description: "async def run_prompt(number_of_states):\n out = \"\"\n for s - IdentifierReferredTo: - number_of_states - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - Constant: "\n" - Attribute: split @@ -44,23 +71,38 @@ description: "async def run_prompt(number_of_states):\n out = \"\"\n for s - IdentifierReferredTo: - get_states_first_letters - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - IdentifierReferredTo: - out - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - IdentifierReferredTo: - state - true -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - InCallExpression - IdentifierReferredTo: - first_letter - false -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - Constant: demo -- - InFunction: run_prompt +- - InFunction: + - run_prompt + - start: 0 + end: 202 - Constant: demo - IdentifierReferredTo: - out diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_function_with_arguments.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_function_with_arguments.snap index 1d0ca3f..9e8d7a7 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_function_with_arguments.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_function_with_arguments.snap @@ -2,40 +2,67 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "async def complex_args_function(a, b, c=2, d=3):\n return a + b + c + d\n " --- -- - InFunction: complex_args_function -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - FunctionArguments - IdentifierReferredTo: - a - false -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - FunctionArguments - IdentifierReferredTo: - b - false -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - FunctionArguments - IdentifierReferredTo: - c - false -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - FunctionArguments - IdentifierReferredTo: - d - false -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - IdentifierReferredTo: - a - true -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - IdentifierReferredTo: - b - true -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - IdentifierReferredTo: - c - true -- - InFunction: complex_args_function +- - InFunction: + - complex_args_function + - start: 0 + end: 73 - IdentifierReferredTo: - d - true diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_class.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_class.snap index 9273518..04b9051 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_class.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_class.snap @@ -4,22 +4,34 @@ description: "import unittest\n\nclass TestMarshalledValues(unittest.TestCase):\ --- - - InClass: TestMarshalledValues - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - FunctionArguments - IdentifierReferredTo: - self - false - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - InCallExpression - InCallExpression - IdentifierReferredTo: - addTwo - false - - InClass: TestMarshalledValues - - InFunction: test_addTwo + - InFunction: + - test_addTwo + - start: 68 + end: 129 - InCallExpression - Attribute: assertEqual - IdentifierReferredTo: diff --git a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_import.snap b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_import.snap index d12dc77..736d336 100644 --- a/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_import.snap +++ b/toolchain/chidori-static-analysis/src/language/python/snapshots/chidori_static_analysis__language__python__parse__tests__report_generation_with_import.snap @@ -2,24 +2,39 @@ source: chidori-static-analysis/src/language/python/parse.rs description: "import random\n\ndef fun_name():\n w = function_that_doesnt_exist()\n v = 5\n return v\n\nx = random.randint(0, 10) " --- -- - InFunction: fun_name -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 15 + end: 90 +- - InFunction: + - fun_name + - start: 15 + end: 90 - AssignmentToStatement - IdentifierReferredTo: - w - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 15 + end: 90 - AssignmentFromStatement - InCallExpression - IdentifierReferredTo: - function_that_doesnt_exist - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 15 + end: 90 - AssignmentToStatement - IdentifierReferredTo: - v - false -- - InFunction: fun_name +- - InFunction: + - fun_name + - start: 15 + end: 90 - IdentifierReferredTo: - v - true