Commit Graph

463 Commits

Author SHA1 Message Date
Eric Traut
9e32b8fd57 Updated documentation to indicate support for PEP 742. 2024-02-19 01:17:00 -07:00
Lucian Wischik
3f6e47f719
Clarify that "exclude" overrides include directories *and* files (#7216)
The exclude directive overrides include directories *and* include files.

I verified by experiment, and also by reading the source code https://github.com/ljw1004/pyright/blob/main/packages/pyright-internal/src/common/uri/uriUtils.ts#L54
2024-02-06 12:02:57 -08:00
Blake Naccarato
9fb26eb7a3
Clarify virtual environment language in exclude part (#7133) 2024-01-26 09:22:57 -08:00
Eric Traut
5aa10443bc Added a few useful links to the docs. 2024-01-21 20:35:11 -08:00
Eric Traut
3ebcef2d90 Fixed minor doc bug. 2024-01-21 20:28:15 -08:00
Eric Traut
197ecd7bc4
Added three new diagnostic rules: reportArgumentType covers argument type compatibility checks, reportAssignmentType covers type compatibility checks for assignments, and reportReturnType covers type compatibility checks for return and yield statements. This partially addresses #6973. (#7077) 2024-01-21 02:20:52 -08:00
Eric Traut
6ac1a7eebf
Added new diagnostic rule reportCallIssue that covers issues relating to call expressions and arguments. This partially addresses #6973. (#7076) 2024-01-21 01:47:43 -08:00
Eric Traut
63637459ca
Added two new diagnostic rules: reportAttributeAccessIssue is related to attribute accesses and reportIndexIssue is related to index operations and expressions. This partially addresses #6973. (#7075) 2024-01-21 01:35:19 -08:00
Eric Traut
8270551bbe
Added two new diagnostic rules: reportAbstractUsage reports invalid use of abstract classes and methods and reportOperatorIssue covers diagnostics related to unary and binary operators. This partially addresses #6973. (#7074) 2024-01-21 01:07:49 -08:00
Eric Traut
ec6052ea9d
Added two new diagnostic rules: reportInvalidTypeArguments reports invalid type arg usage and reportRedeclaration reports attempts to redeclare the type of a symbol. This partially addresses #6973. (#7073) 2024-01-21 00:33:05 -08:00
Eric Traut
7a67f4fbdb
Added two new diagnostic rules: reportInconsistentOverload reports inconsistencies between overload signatures and/or implementation and reportNoOverloadImplementation reports an overloaded function with a missing implementation. This partially addresses #6973. (#7072) 2024-01-21 00:04:55 -08:00
Eric Traut
91960fba49
Added new diagnostic rule reportPossiblyUnboundVariable, which is split off from reportUnboundVariable. This addresses #6896. (#7071) 2024-01-20 23:34:11 -08:00
Eric Traut
aa64fc5dec
Added two new diagnostic rules: reportAssertTypeFailure for type mismatches detected by typing.assert_type and reportUnusedExcept for situations where an except statement is determined to be unreachable. (#7070) 2024-01-20 22:21:42 -08:00
Eric Traut
04e0536a52
Added new diagnostic rule reportInvalidTypeForm that controls reporting of invalid type expression forms. This partly addresses #6973. (#7069) 2024-01-20 21:56:10 -08:00
Eric Traut
cab9f886de Updated "mypy comparison" documentation based on recent improvements in mypy. It's now able to handle higher-order functions. 2024-01-16 00:32:52 -08:00
Eric Traut
cdcd4046b5 Added new language server setting pyright.disableTaggedHints to disable the use of diagnostics hints with tags. Some language server clients do not display these tagged hints in the intended manner and instead treat them as regular diagnostics. 2024-01-14 21:11:13 -08:00
Yashraj Singh
05711a0794
corrected typo in configuration.md (#6950) 2024-01-09 23:30:29 -08:00
Eric Traut
24d9890f36 Added sidebar link to locale documentation section. 2024-01-05 09:46:10 -07:00
Eric Traut
4afd9a4295 Added documentation for overriding the locale via env variables. 2024-01-05 09:44:27 -07:00
Eric Traut
a635a725a0 Updated documentation to refer to "value-constrained" TypeVars rather than just "constrained TypeVars", since all TypeVars are constrained in some manner. 2023-12-31 00:19:46 -07:00
Eric Traut
fd5900f7e7 Clarified that reportOptionalOperand applies only to the LHS operand for binary operators. This addresses #6687. 2023-12-08 19:56:43 -08:00
Eric Traut
9c8a0f1a4a Improved error message for set invariance type violations. This comes from mypy issue https://github.com/python/mypy/issues/16631. 2023-12-07 10:52:16 -08:00
Eric Traut
f605c8fb24
Added a new typeCheckingMode called "standard". It's a subset of "strict" but a superset of "basic". It is the new default mode, and it should cover all of the required checks for conformance with the Python typing standard. This addresses #66607. (#6627) 2023-12-01 23:44:12 -08:00
Eric Traut
d3398850c4 Fixed documentation for class and instance variable overrides. 2023-11-28 13:21:16 -08:00
Eric Traut
5b3523ff53
Added support for parameter type inference for lambdas whose parameters include default arguments. This is analogous to the logic used for unannotated function parameters with default arguments. This addresses #6558. (#6563) 2023-11-27 17:51:31 -08:00
Eric Traut
e4197c3c2b Updated import resolution documentation to cover a case that was previously not mentioned in the docs. This addresses #6415. 2023-11-10 18:28:46 -08:00
Eric Traut
73ec51cb37 Updated docs to further de-emphasize "venv" config option. 2023-11-07 07:44:30 -08:00
Eric Traut
a48b5fed1b Marked PEP 702 as no longer "draft" since it was accepted. 2023-11-07 07:26:42 -08:00
Eric Traut
08a295a261
Added support for python.analysis.include, `python.analysis.exclude… (#6251)
* Added support for `python.analysis.include`, `python.analysis.exclude` and `python.analysis.ignore` settings. These have been implemented in pylance for a while now, but they were never implemented previously in pyright. Also fixed a bug in the original implementation that caused the config file not to override the language server settings for `python.analysis.exclude` and `python.analysis.ignore` as it should. This addresses #6250.

* Removed references to pylance in the help text.
2023-10-29 08:54:14 -07:00
Eric Traut
eee32c3c92 Updated documentation to add PEP 705. 2023-10-23 10:07:16 -07:00
Eric Traut
012dc1c182
Extended the len(x) == L type guard logic to support arbitrary expressions L that evaluate to a literal int type. This addresses #6216. (#6219) 2023-10-21 12:09:19 -07:00
Eric Traut
b360d00ada Updated docs based on a recent change in mypy. 2023-10-21 11:42:54 -07:00
Eric Traut
db8fb3d60c Improved documentation for overload matching. 2023-10-16 13:19:38 -07:00
Eric Traut
a6f27a5dc8 Added PEP 724 to supported PEPs list in the documentation. 2023-10-13 20:11:14 -07:00
Erik De Bonte
4137f0ca43
Docs could be clearer about which .pth files work in editable install scenarios (#6079) 2023-10-03 16:37:00 -07:00
klezm
851571c10f
Adds default value for reportImplicitOverride to docs/configuration.md (#6056) 2023-10-02 07:43:24 -07:00
Eric Traut
fe1e16ec1e
Added a new configuration switch disableBytesTypePromotions that controls whether bytearray and memoryview should be implicit subtypes of bytes. This switch defaults to false in basic type checking mode and true in strict mode. Eventually, we will probably have it default to true in all modes. (#6024)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-09-25 12:00:40 -07:00
Eric Traut
66bf443e1c Updated documentation to reflect recent addition to mypy functionality. 2023-08-28 08:10:28 -07:00
Eric Traut
9cce48b6e3 Updated mypy comparison documentation. This addresses #5818. 2023-08-26 07:45:35 -07:00
Eric Traut
4474b7d36b
Added a new configuration option deprecateTypingAliases that enables deprecation detection and reporting for symbols imported from the typing module that are deprecated according to PEP 585 and 604. The option is currently disabled by default (even in strict mode) but can be enabled manually. This addresses #3598. (#5812)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-08-25 11:17:37 -07:00
Eric Traut
e2cf85f24c Updated mypy comparison to reflect the fact that mypy's support for ParamSpecs now supports overloaded functions. 2023-08-21 11:04:30 -07:00
Eric Traut
050a3c6cea Fixed a bug in the command-line version of pyright where it did not enable "auto search paths", so it didn't automatically add "src" as an extra path. This addresses https://github.com/microsoft/pyright/issues/4771. 2023-07-31 23:27:45 -06:00
Eric Traut
3f7c20213d Documented the difference between mypy's and pyright's handling of None return type. 2023-07-30 10:41:23 -06:00
Eric Traut
501681295b
Modified type inference logic so methods that raise an exception whose type derives from NotImplementedError is not inferred to return NoReturn. Previously, only NotImplementedError was exempted, not subclasses. This addresses https://github.com/microsoft/pyright/issues/5608. (#5609)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-07-29 22:45:10 -06:00
Eric Traut
d81ffb7b5c Added a new configuration options flag called enableExperimentalFeatures that controls whether certain experimental features are enabled. Currently there are three features under this flag: StrictTypeGuard, ReadOnly fields for typed dicts, and inlined TypedDict definitions. This addresses https://github.com/microsoft/pyright/issues/5598. 2023-07-28 22:22:08 -06:00
Eric Traut
9fd63fea86 Fixed small typo in documentation. 2023-07-26 21:57:51 -06:00
Eric Traut
a34eb58fc9 Added section on plugins to the comparison with mypy. 2023-07-22 08:25:37 -07:00
Eric Traut
99dfe982a1 Added documentation about overloads and ParamSpec. 2023-07-22 07:23:43 -07:00
Eric Traut
19194dd089
Fixed an inconsistency in reporting of unbound variables when the variable is captured by an inner scope. The new behavior correctly identifies unbound (or potentially unbound) variables in cases where the captured variable is narrowed. This happens when there are no assignments to the variable after it is captured. This addresses #5548. (#5551)
Fixed a bug in type narrowing for captured variables. Captured variables that are modified in other scopes using a `nonlocal` or `global` binding should be ineligible for type narrowing.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-07-20 21:08:53 -07:00
Eric Traut
98fcba13dd
Added support for the X is C and X is not C type guard pattern (where C is a class). This addresses #5490. (#5544)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-07-19 20:28:55 -07:00