eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py

Fri, 16 Apr 2021 18:03:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 16 Apr 2021 18:03:43 +0200
changeset 8244
ed8cb108b27b
child 8265
0090cfa83159
permissions
-rw-r--r--

Code Style Checker: reworked the type annotations checker.

# -*- coding: utf-8 -*-

# Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing some enums for function type annotations.
"""

#
# adapted from flake8-annotations v2.6.2
#

from enum import Enum, auto


class FunctionType(Enum):
    """
    Class representing the various function types.
    """
    PUBLIC = auto()
    PROTECTED = auto()      # Leading single underscore
    PRIVATE = auto()        # Leading double underscore
    SPECIAL = auto()        # Leading & trailing double underscore


class ClassDecoratorType(Enum):
    """
    Class representing the various class method decorators.
    """
    CLASSMETHOD = auto()
    STATICMETHOD = auto()


class AnnotationType(Enum):
    """
    Class representing the kind of missing type annotation.
    """
    POSONLYARGS = auto()
    ARGS = auto()
    VARARG = auto()
    KWONLYARGS = auto()
    KWARG = auto()
    RETURN = auto()

eric ide

mercurial