Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Static tracker behavior with multiple targets #54

@billbrod

Description

@billbrod

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions