Fix error in t-suffixed-type-alias (PYI043) example (#8963)

## Summary

For `t-suffixed-type-alias` to trigger, the type alias needs to be
marked as such using the `typing.TypeAlias` annotation and the name of
the alias must be marked as private using a leading underscore. The
documentation example was of an unannotated type alias that was not
marked as private, which was misleading.

## Test Plan

The current example doesn't trigger the rule; the example in this merge
request does.
This commit is contained in:
Tom Kuson 2023-12-02 13:52:50 +00:00 committed by GitHub
parent 5aaf99b856
commit 35082b28cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,12 +46,16 @@ impl Violation for SnakeCaseTypeAlias {
///
/// ## Example
/// ```python
/// MyTypeT = int
/// from typing import TypeAlias
///
/// _MyTypeT: TypeAlias = int
/// ```
///
/// Use instead:
/// ```python
/// MyType = int
/// from typing import TypeAlias
///
/// _MyType: TypeAlias = int
/// ```
#[violation]
pub struct TSuffixedTypeAlias {