If you pass multiple targets to the static tracker, it will only give the outputs from the first file, silently ignoring the rest. This is true for static by itself, and also with the --docstring flag. It should probably either parse all the files or raise an Exception if it gets multiple files?
Minimal working example:
file example1.py:
from r2t2 import add_reference
@add_reference(
short_purpose="Roasted chicken recipe", reference="Great British Roasts, 2019"
)
def sample_function_1():
pass
file example2.py:
from r2t2 import add_reference
@add_reference(
short_purpose="Roasted beef recipe", reference="Great British Roasts, 2019"
)
def sample_function_2():
pass
Run:
python -m r2t2 --static example1.py example2.py
Output:
Referenced in: sample_function_1
Source file: example1.py
Line: 7
[1] Roasted chicken recipe - Great British Roasts, 2019
Expected output:
Referenced in: sample_function_1
Source file: example1.py
Line: 7
[1] Roasted chicken recipe - Great British Roasts, 2019
Referenced in: sample_function_2
Source file: example2.py
Line: 7
[1] Roasted beef recipe - Great British Roasts, 2019
If you pass multiple targets to the static tracker, it will only give the outputs from the first file, silently ignoring the rest. This is true for static by itself, and also with the
--docstringflag. It should probably either parse all the files or raise an Exception if it gets multiple files?Minimal working example:
file
example1.py:file
example2.py:Run:
Output:
Expected output: