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:
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:
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
- fix locale parsing on Linux by @arenekosreal in #834
- Fix file rename check running on files that aren't part of the workspace by @DetachHead in #843
- fix inlay hints appearing on
super()
calls by @DetachHead in #847 - update upstream pyright version to 1.1.388 by @DetachHead in #851
New Contributors
- @arenekosreal made their first contribution in #834
Full Changelog: v1.20.0...v1.21.0