Eric Traut
8458382477
Implemented a new --level
command-line option that allows filtering of 'information' and 'warning' diagnostics.
2022-12-14 09:20:15 -08:00
Eric Traut
31c5e27e15
Restored changes that were inadvertently overwritten by a merge from pylance.
2022-12-13 18:10:44 -08:00
Eric Traut
da5553515e
Published 1.1.284
2022-12-13 17:49:56 -08:00
Eric Traut
d3a6875e70
Fixed regression that resulted in inconsistent behavior when useLibraryCodeForTypes
is false and a symbol is imported from a non-py.typed library. This addresses https://github.com/microsoft/pyright/issues/4310 .
2022-12-13 17:47:49 -08:00
Eric Traut
3c2d1230cd
Fixed a bug that led to a false positive when a NoReturn
or Never
type argument was used for a covariant type parameter. This addresses https://github.com/microsoft/pyright/issues/4309 .
2022-12-13 00:40:30 -08:00
Rich Chiodo
f724479501
Fix exclusions/inclusions to work with '.' prefixed directories ( #4323 )
...
* Match on '.' prefixed directories too
* Exclude the '.' folder but nothing else. Add more tests
* Fix window test failures
2022-12-12 14:08:02 -08:00
Rich Chiodo
4897e993d5
Fix 'reportShadowedImports' link
...
Fixes https://github.com/microsoft/pylance-release/issues/3752
2022-12-12 09:51:37 -08:00
Eric Traut
8e4ad79e97
Added check for disallowed expression forms used with TypeAlias
and with PEP 695 type
statement. This addresses https://github.com/microsoft/pyright/issues/4320 .
2022-12-11 19:45:17 -08:00
Eric Traut
44b1c3046c
Updated typeshed stubs to the latest version.
2022-12-11 15:33:55 -08:00
Eric Traut
b5b389e9c9
Fixed false positive error in multi-inheritance override check in cases where the override symbol was provided by one of the base classes. This addresses https://github.com/microsoft/pyright/issues/4319 .
2022-12-11 15:28:27 -08:00
Eric Traut
985700c526
Added missing diagnostic rule in diagnostics reported as part of the reportImportCycles
check. Thanks for @parched for this fix. This addresses https://github.com/microsoft/pyright/pull/4316 .
2022-12-11 07:51:06 -08:00
Eric Traut
8f96d50e74
Fixed a bug that led to a false positive error when evaluating a recursive type alias definition that uses a generic type that is parameterized using a bound or constrained type variable. This addresses https://github.com/microsoft/pyright/issues/4315 .
2022-12-10 19:43:23 -08:00
Eric Traut
439d11e5bd
Removed unnecessary code from test case.
2022-12-10 17:35:25 -08:00
Eric Traut
d93355cb04
Improved bidirectional type inference for list, set and dictionary expressions when the "expected type" is a union that contains multiple potentially-compatible subtypes. This addresses https://github.com/microsoft/pyright/issues/4313 .
2022-12-10 11:31:12 -08:00
Eric Traut
0031cc4d69
Fixed bugs that resulted in false positive errors when assigning a type
to a Callable
and when accessing members from a type[T]
or a T
that is bound to type
. This addresses https://github.com/microsoft/pyright/issues/4291 and https://github.com/microsoft/pyright/issues/4258 .
2022-12-09 22:49:56 -08:00
Eric Traut
82aa5f13b3
Fixed bug that resulted in an incorrect target range when resolving the declaration of an import. There were cases where "Go To Declaration" would take you to a location within the target file that corresponded to the offset of the import statement within the importing file.
2022-12-09 21:36:17 -08:00
Eric Traut
5f48e39671
Exposed new configuration setting analyzeUnannotatedFunctions
which corresponds to the --skipunannotated
command-line option. Added an information diagnostic for skipped functions. This addresses https://github.com/microsoft/pyright/issues/4303 .
2022-12-08 20:05:32 -08:00
Eric Traut
1d6a5f385e
Fixed recent regression that caused the hover text for a function symbol to be improperly formatted if its type was evaluated to something other than a function.
2022-12-08 20:03:55 -08:00
Eric Traut
885f48e834
Removed diagnostic check that detects a non-ellipsis default value in a stub file. This check was based on a now-outdated best practice. We now recommend that stubs include default values for better usability in language servers.
2022-12-08 11:19:43 -08:00
Eric Traut
a190634c51
Fixed a bug that resulted in an incorrect type evaluation when using a literal integer index into a tuple that includes an unpacked TypeVarTuple element. This addresses https://github.com/microsoft/pyright/issues/4299 .
2022-12-07 23:35:16 -08:00
PylanceBot
bbf0ae7848
pull-pylance-with-pyright-1.1.283 ( #4295 )
2022-12-07 10:20:32 -08:00
Eric Traut
5c8f84f12e
Published 1.1.283
2022-12-06 23:31:24 -08:00
Eric Traut
2f331fed60
Fixed bug that resulted in a false positive reportPrivateImportUsage
diagnostic when importing from a py.typed library under certain circumstances. This addresses https://github.com/microsoft/pyright/issues/4287 .
2022-12-06 09:47:05 -08:00
Eric Traut
0a18d907ce
Fixed bug that led to a false positive error when using an unpacked argument that has a declared type that is a tuple with an unpacked TypeVarTuple. This addresses https://github.com/microsoft/pyright/issues/4278 .
2022-12-05 22:12:26 -08:00
Eric Traut
452872da43
Fixed bug that resulted in a false positive when passing an unpacked dict or unpacked iterable argument to the constructor of a class that has no __init__
and therefore uses object.__init__
. This addresses https://github.com/microsoft/pyright/issues/4273 .
2022-12-05 21:58:47 -08:00
Eric Traut
3ba6f3beec
Added logic to limit recursion when handling type compatibility checks between two different recursive type aliases that have the same definition.
2022-12-05 20:13:24 -08:00
Eric Traut
14d0f5dd1e
Added small perf optimization for determining type compatibility between two unions, especially in cases where the number of items in the union is large.
2022-12-05 19:46:10 -08:00
Eric Traut
f3c536f045
Updated typeshed stubs to the latest version.
2022-12-05 18:39:03 -08:00
Rich Chiodo
c9c6584342
Show doc strings on module part hover ( #4283 )
...
* Make hover show doc strings regardless of whether module is used or not
* Remove dupe code
* Review feedback
* Add more tests and remove unnecessary code in _addDocumentationParts
* Add test with docstring in stub
* Build error
2022-12-05 16:49:54 -08:00
Rich Chiodo
69a610f0ab
Make sure no stdlib modules starting with '_' are counted as stdlib modules ( #4282 )
2022-12-05 10:26:04 -08:00
Rich Chiodo
d697ac24a0
Allow relative imports for stdlib modules ( #4270 )
...
* Allow relative imports for stdlib modules
* Use another way to check if relative
2022-12-05 10:00:46 -08:00
Eric Traut
bedc124c39
Added support for frozen_default
for dataclass_transform
.
2022-12-02 04:35:05 -08:00
Eric Traut
9b4441923d
Fixed a recent regression that led to a false negative when evaluating the type of an unannotated variable in a loop. This addresses https://github.com/microsoft/pyright/issues/4254 .
2022-12-01 22:46:25 -08:00
Eric Traut
4fc1a909c7
Changed ParamSpec capture logic to track the expression used for a default argument value. This addresses https://github.com/microsoft/pyright/issues/4265 .
2022-12-01 17:40:30 -08:00
Eric Traut
d9119ed758
Fixed a bug that resulted in a false positive diagnostic when importing a symbol from a "py.typed" library that was imported (and re-exported) from a non-"py.typed" library. This addresses https://github.com/microsoft/pyright/issues/4253 .
2022-12-01 17:22:18 -08:00
Eric Traut
03fbe44edb
Fixed a bug that resulted in incorrect type evaluation when assigning an unpacked TypeVarTuple to a regular (non-variadic) TypeVar during constraint solving. This should result in a union of the TypeVarTuple types. This addresses https://github.com/microsoft/pyright/issues/4252 .
2022-12-01 11:15:30 -08:00
Eric Traut
75f439b553
Fixed a regression related to a recent change in typeshed that caused imports from google.cloud
namespace packages to fail. This addresses https://github.com/microsoft/pyright/issues/4255 .
2022-11-30 21:37:33 -08:00
Eric Traut
f0405b5851
Fixed recent regression that resulted in a false positive when a type[T]
was assigned to a Callable[..., T]
. This addresses https://github.com/microsoft/pyright/issues/4258 .
2022-11-30 21:32:11 -08:00
Eric Traut
b6f5c48c18
Fixed broken test on Windows.
2022-11-30 20:45:08 -08:00
Eric Traut
76a1efdd79
Improved parse recovery for common indent/dedent conditions. This addresses https://github.com/microsoft/pyright/issues/4261 .
2022-11-30 18:28:32 -08:00
Eric Traut
1fa84c09a3
Added support for # pyright: ignore
and # type: ignore
comments that are not at the start of a comment. This addresses https://github.com/microsoft/pyright/issues/4259 .
2022-11-30 17:45:03 -08:00
PylanceBot
621d886be1
pull-pylance-with-pyright-1.1.282 ( #4257 )
2022-11-30 10:37:16 -08:00
Eric Traut
a3fc8b8789
Published 1.1.282
2022-11-29 21:22:53 -08:00
PylanceBot
70abaa6fee
pull-pylance-with-pyright-1.1.281 ( #4249 )
2022-11-29 13:03:45 -08:00
Eric Traut
af4f69c571
Fixed a bug that led to an incorrect type evaluation when an empty list or dict literal is included in a list expression with an "expected type" (i.e. bidirectional type inference is being attempted). This addresses https://github.com/microsoft/pyright/issues/4244 .
2022-11-28 22:35:20 -08:00
Eric Traut
92717fd142
Changed reportUnnecessaryTypeIgnoreComment
to to ignore # type: ignore
comments if enableTypeIgnoreComments
is set to false.
2022-11-28 17:37:56 -08:00
Eric Traut
f2accfcc00
Added code to report an error if a from __future__ import x
statement is not found at the beginning of a file. This results in a syntax error.
2022-11-25 16:53:14 -08:00
Eric Traut
333b828032
Fixed a bug that results in a false positive error when a dataclass field in a child class overrides a non-init dataclass field in a parent class. This addresses https://github.com/microsoft/pylance-release/issues/3676 .
2022-11-25 15:59:43 -08:00
Eric Traut
5e7d387a1b
Improved perf slightly by moving the calculation of the effective combined type for branches and loops in the code flow engine from the "read" path to the "write" path.
2022-11-25 11:18:16 -08:00
Eric Traut
69c2e9a8fe
Revert "Fixed recent regression that caused symbol type resolution to cache an incomplete type."
...
This reverts commit d5b7e8492b
.
2022-11-25 11:12:12 -08:00