diff --git a/ChangeLog b/ChangeLog index 33dacc56bf..9ce5147aa0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -450,6 +450,11 @@ Release date: TBA Insert your changelog randomly, it will reduce merge conflicts (Ie. not necessarily at the end) +* Improve ``invalid-name`` check for ``TypeVar`` names. + The accepted pattern can be customized with ``--typevar-rgx``. + + Closes #3401 + * Added new checker ``typevar-name-missing-variance``. Emitted when a covariant or contravariant ``TypeVar`` does not end with ``_co`` or ``_contra`` respectively or when a ``TypeVar`` is not either but has a suffix. diff --git a/doc/user_guide/options.rst b/doc/user_guide/options.rst index 898c7a60a7..6e1535e249 100644 --- a/doc/user_guide/options.rst +++ b/doc/user_guide/options.rst @@ -39,6 +39,8 @@ name is found in, and not the type of object assigned. +--------------------+---------------------------------------------------------------------------------------------------+ | ``inlinevar`` | Loop variables in list comprehensions and generator expressions. | +--------------------+---------------------------------------------------------------------------------------------------+ +| ``typevar`` | Type variable declared with ``TypeVar``. | ++--------------------+---------------------------------------------------------------------------------------------------+ Default behavior ~~~~~~~~~~~~~~~~ @@ -82,6 +84,19 @@ Following options are exposed: .. option:: --inlinevar-naming-style=