diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-03-28 22:55:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 22:55:13 +0200 |
commit | 4e11693a411433cb03b07fc3a04f2e4151280953 (patch) | |
tree | b868da27bd7e21f22e9ff93f7ea6ee097ee21857 /doc | |
parent | d429822d56c392b4be914f94d55807b55efbd705 (diff) | |
download | pylint-git-4e11693a411433cb03b07fc3a04f2e4151280953.tar.gz |
[Backport maintenance/2.17.x] Allow integers in TypeAlias names. (#8507)
Co-authored-by: Stephane Odul <1504511+sodul@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/data/messages/i/invalid-name/details.rst | 10 | ||||
-rw-r--r-- | doc/whatsnew/fragments/8485.false_positive | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/doc/data/messages/i/invalid-name/details.rst b/doc/data/messages/i/invalid-name/details.rst index ad155bc14..7e2090158 100644 --- a/doc/data/messages/i/invalid-name/details.rst +++ b/doc/data/messages/i/invalid-name/details.rst @@ -88,11 +88,11 @@ The following type of names are checked with a predefined pattern: | ``typevar`` | ``T``, ``_CallableT``, ``_T_co``, ``AnyStr``, | ``DICT_T``, ``CALLABLE_T``, ``ENUM_T``, ``DeviceType``, | | | ``DeviceTypeT``, ``IPAddressT`` | ``_StrType`` | +--------------------+-------------------------------------------------------+------------------------------------------------------------+ -| ``typealias`` | ``GoodName``, ``_GoodName``, ``IPAddressType`` and | ``BadNameT``, ``badName``, ``TBadName``, ``TypeBadName`` | -| | other PascalCase variants that don't start with ``T``| | -| | or ``Type``. This is to distinguish them from | | -| | ``typevars``. Note that ``TopName`` is allowed but | | -| | ``TTopName`` isn't. | | +| ``typealias`` | ``GoodName``, ``_GoodName``, ``IPAddressType``, | ``BadNameT``, ``badName``, ``TBadName``, ``TypeBadName``, | +| | ``GoodName2`` and other PascalCase variants that | ``_1BadName`` | +| | don't start with ``T`` or ``Type``. This is to | | +| | distinguish them from ``typevars``. Note that | | +| | ``TopName`` is allowed but ``TTopName`` isn't. | | +--------------------+-------------------------------------------------------+------------------------------------------------------------+ Custom regular expressions diff --git a/doc/whatsnew/fragments/8485.false_positive b/doc/whatsnew/fragments/8485.false_positive new file mode 100644 index 000000000..8eac08b95 --- /dev/null +++ b/doc/whatsnew/fragments/8485.false_positive @@ -0,0 +1,5 @@ +``invalid-name`` now allows for integers in ``typealias`` names: +- now valid: ``Good2Name``, ``GoodName2``. +- still invalid: ``_1BadName``. + +Closes #8485 |