borg icon indicating copy to clipboard operation
borg copied to clipboard

Add pydantic models for borg 1.x's CLI (#8338)

Open a-gn opened this issue 1 year ago • 15 comments

This adds pydantic models for borg's CLI outputs (fixes #8338).

Sadly I can't try to run these tests locally; when trying to run tox or pip install borg I get OSError: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory').

a-gn avatar Aug 26 '24 18:08 a-gn

I've checked this and they don't return selectors anymore. In the new system existingMethodsThatReferToInstanceVariable: returns CompiledMethod but whichMethodsReferToInstanceVariable: is tricky because it returns both CompiledMethods (since it uses the method from above). But it also return RBMethod for every new method that is added. This might be OK if API is polymorphic between CompiledMethod and RBMethod, but I didn't check that. Maybe we can close this and open a new issue for this if it is needed in the first place.

Code to reproduce:

ns := RBNamespace new.
cls := ns classNamed: 'RBClass'.
cls compile: 'asdf1234 ^ tagName' classified: 'to remove'.
cls existingMethodsThatReferToInstanceVariable: #'tagName'.
cls whichMethodsReferToInstanceVariable: #'tagName'.

Image

balsa-sarenac avatar Feb 27 '24 10:02 balsa-sarenac