Tags: vasilemarin/pyre-check
Tags
automatically add taint models path to configuration when running `py… …re init` Summary: This moves us towards our goal of making Pysa trivial to pick up - new projects that run `pyre init` will get the taint models filled out for them, so that you should be able to run `pyre analyze` off the bat. Should have no effect for non-security users. Reviewed By: grievejia Differential Revision: D19156586 fbshipit-source-id: 88f4c8e3ae703d9ad0a3cb632fc60d2e94a762d6
Re-introduce main method in upgrade module
Summary:
If I'm understanding correctly, the way buck builds modules relies on a `main` being importable from the specified main module.
Otherwise this will be broken when built and packaged for open source:
```
szhu@szhu-mbp tmp % pyre-upgrade fixme-single .
Traceback (most recent call last):
File "/usr/local/bin/pyre-upgrade", line 6, in <module>
from pyre_check.tools.upgrade.upgrade import main
ImportError: cannot import name 'main' from 'pyre_check.tools.upgrade.upgrade' (/usr/local/lib/python3.7/site-packages/pyre_check/tools/upgrade/upgrade.py)
szhu@szhu-mbp tmp %
```
Reviewed By: MaggieMoss
Differential Revision: D19145223
fbshipit-source-id: f9458838cf8bc060e366f3ca6f24e81482a8ec95
Make global for class name have normal original Summary: I discovered this while implementing the new version of global registration. This evidently dates back to the original implementation of registering classes as meta types: D6643297. I'm not sure why this was chosen, since it allows people to redefine their classes locally, which we don't support in a consistent manner. Reviewed By: grievejia Differential Revision: D17619648 fbshipit-source-id: 7a0be0b90902a9e1097e5589fe919f2099595a39
Make global for class name have normal original Summary: I discovered this while implementing the new version of global registration. This evidently dates back to the original implementation of registering classes as meta types: D6643297. I'm not sure why this was chosen, since it allows people to redefine their classes locally, which we don't support in a consistent manner. Reviewed By: grievejia Differential Revision: D17619648 fbshipit-source-id: 7a0be0b90902a9e1097e5589fe919f2099595a39
Fix dequalification and default to `test.py` for integration tests Summary: For our integration tests, we have this hack of pretending the source files all have the filename `__init__.py`, whose corresponding reference qualifier is `Reference.empty`. SInce in most of our integration tests we assume that the source file has no qualifiers attached, this hack saved us some effort of porting the error messages over. ... But a hack is still a hack: empty qualifier does not play nicely with the majority of our system, and it creates surprising breakage every now and then. Let's get rid of it to avoid creating more test maintenance burden in the future. This diff makes it so that by default, `Test.assert_errors` uses `test.py` as the filename for the source. This lead to changes in error messages on most of our integration tests, and I use 2 strategies to fix them: - Ideally, no qualifier should be shown in our error message thanks to dequalification. If the `test` qualifier is shown, it usually means that certain part of the error message did not get correctly dequalified. I try to patch up those as much as possible. - Sometimes it is really difficult to patch the dequalification issue. For example, when the message contains an expression, there's no obvious way to dequalify it without existing APIs. For these cases, I would change the expected error message directly. Proper dequalification for them can be left as future work. NOTE: Both `Test.parse` and `Test.parse_untrimmed` still default to empty filename. Dealing with them can be a separate diff. Reviewed By: dkgi Differential Revision: D17127037 fbshipit-source-id: 1f2124231ba1a1f7896c6ef935040336302f27ce
PreviousNext