facebook / pyre-check

Performant type-checking for python.
https://pyre-check.org/
MIT License
6.86k stars 437 forks source link

Pysa unable to use models with special characters / reserved keywords #899

Open giusepperaffa opened 4 months ago

giusepperaffa commented 4 months ago

I have been trying to use Pysa (Ubuntu 20.04 + virtual environment + Python 3.8) to perform the data flow analysis of repositories with folders' names containing:

Pysa generally requires fully qualified names in its models, which implies that the dash character as well as the word lambda end up being included in such models. When this happens though, Pysa throws a syntax error, presumably because it processes the models by using the Python identifiers' rules.

The obvious solution would be to edit the problematic folders' names or to avoid using the dash character and the word lambda altogether. However, I am currently analysing a dataset of repositories authored by others, and I would not be inclined to modify them in order to avoid inconsistencies.

I would appreciate if someone could tell me whether there is either a workaround to this issue or a Pysa configuration option that can be helpful in these cases.

Thank you very much.