Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

feat: resolve references #153

Merged
merged 209 commits into from
Oct 2, 2023
Merged

feat: resolve references #153

merged 209 commits into from
Oct 2, 2023

Conversation

lukarade
Copy link
Contributor

@lukarade lukarade commented Aug 15, 2023

Closes #90

Summary of Changes

This feature contains many additions to the collection of data when parsing python code (former scope detection).
We now collect: the scope, the classes, the functions, all global variables, all value and target nodes, the parameters as well as all function calls when traversing the AST.
During this traversal, we also determine the symbols for all name nodes.
We distinguish between GlobalVariables, LocalVariables, ClassVariables, InstanceVariables, Parameters and Builtins.

Furthermore, this feature resolves the references for all name nodes (target and value nodes).
For each name node we determine its scope, as mentioned above, and a list of all referenced symbols and return a ReferenceNode.

lukarade and others added 30 commits April 7, 2023 03:30
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #153 (813a176) into main (45b1329) will increase coverage by 0.12%.
The diff coverage is 95.18%.

@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
+ Coverage   92.71%   92.83%   +0.12%     
==========================================
  Files          90       95       +5     
  Lines        5313     5794     +481     
==========================================
+ Hits         4926     5379     +453     
- Misses        387      415      +28     
Files Coverage Δ
src/library_analyzer/cli/_run_api.py 100.00% <ø> (ø)
src/library_analyzer/processing/api/__init__.py 100.00% <ø> (ø)
.../library_analyzer/processing/api/model/__init__.py 100.00% <ø> (ø)
...nalyzer/processing/api/purity_analysis/__init__.py 100.00% <100.00%> (ø)
...er/processing/api/purity_analysis/_infer_purity.py 92.98% <100.00%> (ø)
...cessing/api/purity_analysis/_resolve_references.py 100.00% <100.00%> (ø)
...r/processing/api/purity_analysis/model/__init__.py 100.00% <100.00%> (ø)
...er/processing/api/purity_analysis/model/_purity.py 88.76% <ø> (ø)
...processing/api/purity_analysis/model/_reference.py 64.28% <64.28%> (ø)
...processing/api/purity_analysis/_get_module_data.py 97.58% <97.58%> (ø)
... and 1 more

... and 2 files with indirect coverage changes

@lukarade lukarade marked this pull request as ready for review September 28, 2023 16:07
@lukarade lukarade requested review from a team and lars-reimann as code owners September 28, 2023 16:07
@lars-reimann
Copy link
Member

Please fix the warnings that occur when building the documentation:

WARNING -  griffe: src/library_analyzer/processing/api/purity_analysis/_resolve_references.py:348: Could not parse line '    * code: the code of the module for which we want to resolve the references'
WARNING -  griffe: src/library_analyzer/processing/api/purity_analysis/_resolve_references.py:348: Empty parameters section at line 9

Copy link
Member

@lars-reimann lars-reimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work, thanks a lot!

@lars-reimann lars-reimann merged commit bfcd292 into main Oct 2, 2023
7 checks passed
@lars-reimann lars-reimann deleted the resolve-references_new branch October 2, 2023 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function to resolve references
3 participants