False positive on Type Aliases names

Current SonarCloud, Python 3.9.5, mypy 0.812.

from typing import Type

class MyClass:
    """My class"""

MyType = Type[MyClass]
AliasType = Union[List[Dict[Tuple[int, str], Set[int]]], Tuple[str, List[str]]]

These two type aliases are raising python:S117 as a naming convention issue.

See:
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#type-aliases
https://mypy.readthedocs.io/en/stable/generics.html#generic-type-aliases

Hi @sodul ,
Thanks for reporting this FP: indeed, S117 shouldn’t raise any issue for type aliases.
I created SONARPY-862 to keep track of this FP.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.