astpath
astpath copied to clipboard
A command-line search utility for Python ASTs using XPath syntax.
Printing a bytes string looks unreadable in the terminal e.g. ``` b'\n \n' ``` What we want is more like: ``` ``` Specify encoding to do this Works for both...
I'd like to print an attribute, but I'm getting an error: ```console $ astpath '//Name/@id' Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/astpath/search.py", line 44, in find_in_ast linenos = query( File...
Removed setup.py. Added pyproject.toml Version is now fetched from git tags.
I'm currently using `astpath` to determine if we need a function's lone keyword to be optional, or if all of its callers pass it and therefore we can make it...
Added a call to service x so that we can get json response.
```py search("core", ".//Call/func/Name[@id='AccountFrozenEmail']", recurse=True, print_matches=True) [('core/services/account.py', 15)] ``` Instead of printing matches, would it be possible to return the matches as strings?
Given #13, I would like to run `astpath` explicitly against my code directory (`cloudinit/`) and my legacy tests directory (`tests/`). If I invoke `astpath` with both directories: astpath "//Str[@s='system']" -d...
This is unlikely to be the desired behaviour of most users.
Currently, searching a directory that doesn't exist will silently fail. ``` $ astpath -d /tmp/this-dir-doesnt-exist './/Try' ``` If a directory doesn't exist because I misspelled it, I'd like to get...