github DetachHead/basedpyright v1.21.0
v1.21.0 (pyright 1.1.388)

one day ago

What's Changed

new "hint" diagnostic category

previously, in addition to the standard diagnostic categories "error" and "warning", some diagnostic rules such as reportUnreachable and reportDeprecated supported special diagnostic categories like "unreachable" and "deprecated" respectively, which would show as a hint in your editor instead of an error:

image

the issue with these hints is that they only make sense for diagnostic rules that relate to unnecessary or deprecated code. but there was no way to set a hint-level diagnostic for other diagnostic rules. the configuration for these hints was also needlessly confusing (eg. "unreachable" and "unused" look exactly the same). they also didn't make sense for editors that don't support diagnostic tags.

this release introduces the new "hint" diagnostic category to replace the "deprecated", "unused" and "unreachable" categories, which are now deprecated. for most rules, they will display as a hint:

image

but for rules where it makes sense to do so, the appropriate diagnostic tag (unnecessary or deprecated) will be applied automatically. this also allows all baselined diagnostics to be displayed as a hint, rather than just ones that can be considered unreachable/unnecessary.

for more information, see the docs

(implemented in #845)

other changes

New Contributors

Full Changelog: v1.20.0...v1.21.0

Don't miss a new basedpyright release

NewReleases is sending notifications on new releases.