Tags: facebook/pyre-check
Tags
Prevent users from shadowing `builtins.pyi` in ptt Summary: When using buck-based per-target type checking, we realised that it is possible for users, by setting `base_module = ''` and having an `__init__.py`, to shadow `builtins.py`. This is pretty confusing because there's no user-visible indication that this is happening, and we just get tons of type errors on all the builtin types being undefined. Reviewed By: grievejia D 8000 ifferential Revision: D65076559 fbshipit-source-id: d1ea05c3d0b5c6a8b2e114ba42fb7b81e2f1f1a8
sanitize type annotation in error message Summary: as pointed out by grievejia some things like type variables are rendered poorly when using `Expression.show`, so this diff sanitizes them first see the conformance output for changes Reviewed By: grievejia Differential Revision: D59039786 fbshipit-source-id: d9b20d472bec2fdd1a8af17c80cd3b1e2558f34b
Guard invalid python annotations for 3.8 / 3.9 (#848) Summary: Pull Request resolved: #848 This is blocking an open source release. Note: there's a test failure still in OSS in one of these tests. We do need to fix that, but unlike using illegal-for-python-3.9 syntax it doesn't make Pyre unreleasable. Reviewed By: connernilsen Differential Revision: D57218457 fbshipit-source-id: 4691f2ef8be0f88effb9ce0a490d82e8fda2fa35
Use Subscript-compatible logic for `__setitem__` in typeCheck.ml Summary: In order to make it easy to roll out the sweeping changes when I add a Subscript node to the AST and cut over `__getitem__` in the parser, I first want to make sure existing uses of the `special = true` `__getitem__` are always handled in a way that is: - distinct from the "vanilla" `Expression.Call` case - compatible with what Subscript will get us, which is just `base` and `index` (so basically, don't use the `callee` or other parts of the `__getitem__` `Call` node that won't exist after cutting over) This diff makes that change in the part of `typeCheck.ml` where we are handling subscript assignment targets: only rely on `base` and `index` here when constructing synthetic `__setitem__` call data, so that we'll be able to just drop in a `Subscript` match with the same body. Reviewed By: yangdanny97 Differential Revision: D57113190 fbshipit-source-id: c03e595a7c4a33bc910a0de32b73e57a51436e65
Use DaemonStatus to encapsulate time + connection status Summary: We always want both the connection status before and information about how long it has been since the server is ready; this combination of information makes it much easier to judge how big a problem availability is, because - we can't decide whether incremental status is bad or not *at all* without a timer, since it's expected that we'll be briefly busy - even for other statuses like starting, it's very helpful to have a record of how long start took; this, for example, can help us distinguish between an availability problem due primarily to long start times versus a problem due primarilily to frequent deamon (or persistent) restarts Putting these fields in the same dataclass makes it easier to ensure we always do the right thing, and that the logging is consistent across all telemetry events. It's worth noting that I caught another bug here: we weren't logging status in the telemetry for type coverage; this isn't a big deal today but it could be one if we ever start seeing heavy use of expression-level coverage. Reviewed By: grievejia Differential Revision: D43244195 fbshipit-source-id: d5ff1b0a39e2b09e3873a3131373a7f466c77d5d
Refactor parsing logic of expression level json Summary: ### Context: We want to refactor the parsing logic of `ExpressionLevelCoverageResponse` json before working onVSCode requests/responses, which will likely require similar code. ### Problem: Currently, `ExpressionLevelCoverageResponse` contains a `List[Union[CoverageAtPathResponse, ErrorAtPathResponse]]`. The `dataclasses json` library can't parse `Union` types, so the existing code was messy and needed to be refactored. ### Solution: We extract parsing of a `ExpressionLevelCoverageResponse` into a separate function instead of having some logic leak into `summary_expression_level`. Reviewed By: pradeep90 Differential Revision: D37529463 fbshipit-source-id: 12ef0d6253cfb5e1b5d22849899630fb8a37a101
PreviousNext