File size: 5,559 Bytes
d631808
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# This module contains all the enumerations of the package.

from __future__ import annotations

from enum import Enum


class LogLevel(str, Enum):
    """Enumeration of available log levels."""

    trace = "trace"
    """The TRACE log level."""
    debug = "debug"
    """The DEBUG log level."""
    info = "info"
    """The INFO log level."""
    success = "success"
    """The SUCCESS log level."""
    warning = "warning"
    """The WARNING log level."""
    error = "error"
    """The ERROR log level."""
    critical = "critical"
    """The CRITICAL log level."""


class DocstringSectionKind(str, Enum):
    """Enumeration of the possible docstring section kinds."""

    text = "text"
    """Text section."""
    parameters = "parameters"
    """Parameters section."""
    other_parameters = "other parameters"
    """Other parameters (keyword arguments) section."""
    raises = "raises"
    """Raises (exceptions) section."""
    warns = "warns"
    """Warnings section."""
    returns = "returns"
    """Returned value(s) section."""
    yields = "yields"
    """Yielded value(s) (generators) section."""
    receives = "receives"
    """Received value(s) (generators) section."""
    examples = "examples"
    """Examples section."""
    attributes = "attributes"
    """Attributes section."""
    functions = "functions"
    """Functions section."""
    classes = "classes"
    """Classes section."""
    modules = "modules"
    """Modules section."""
    deprecated = "deprecated"
    """Deprecation section."""
    admonition = "admonition"
    """Admonition block."""


class ParameterKind(str, Enum):
    """Enumeration of the different parameter kinds."""

    positional_only = "positional-only"
    """Positional-only parameter."""
    positional_or_keyword = "positional or keyword"
    """Positional or keyword parameter."""
    var_positional = "variadic positional"
    """Variadic positional parameter."""
    keyword_only = "keyword-only"
    """Keyword-only parameter."""
    var_keyword = "variadic keyword"
    """Variadic keyword parameter."""


class Kind(str, Enum):
    """Enumeration of the different object kinds."""

    MODULE = "module"
    """Modules."""
    CLASS = "class"
    """Classes."""
    FUNCTION = "function"
    """Functions and methods."""
    ATTRIBUTE = "attribute"
    """Attributes and properties."""
    ALIAS = "alias"
    """Aliases (imported objects)."""


class ExplanationStyle(str, Enum):
    """Enumeration of the possible styles for explanations."""

    ONE_LINE = "oneline"
    """Explanations on one-line."""
    VERBOSE = "verbose"
    """Explanations on multiple lines."""
    MARKDOWN = "markdown"
    """Explanations in Markdown, adapted to changelogs."""
    GITHUB = "github"
    """Explanation as GitHub workflow commands warnings, adapted to CI."""


class BreakageKind(str, Enum):
    """Enumeration of the possible API breakages."""

    PARAMETER_MOVED = "Positional parameter was moved"
    """Positional parameter was moved"""
    PARAMETER_REMOVED = "Parameter was removed"
    """Parameter was removed"""
    PARAMETER_CHANGED_KIND = "Parameter kind was changed"
    """Parameter kind was changed"""
    PARAMETER_CHANGED_DEFAULT = "Parameter default was changed"
    """Parameter default was changed"""
    PARAMETER_CHANGED_REQUIRED = "Parameter is now required"
    """Parameter is now required"""
    PARAMETER_ADDED_REQUIRED = "Parameter was added as required"
    """Parameter was added as required"""
    RETURN_CHANGED_TYPE = "Return types are incompatible"
    """Return types are incompatible"""
    OBJECT_REMOVED = "Public object was removed"
    """Public object was removed"""
    OBJECT_CHANGED_KIND = "Public object points to a different kind of object"
    """Public object points to a different kind of object"""
    ATTRIBUTE_CHANGED_TYPE = "Attribute types are incompatible"
    """Attribute types are incompatible"""
    ATTRIBUTE_CHANGED_VALUE = "Attribute value was changed"
    """Attribute value was changed"""
    CLASS_REMOVED_BASE = "Base class was removed"
    """Base class was removed"""


class Parser(str, Enum):
    """Enumeration of the different docstring parsers."""

    auto = "auto"
    """Infer docstring parser.

    [:octicons-heart-fill-24:{ .pulse } Sponsors only](../../../insiders/index.md){ .insiders } —
    [:octicons-tag-24: Insiders 1.3.0](../../../insiders/changelog.md#1.3.0).
    """
    google = "google"
    """Google-style docstrings parser."""
    sphinx = "sphinx"
    """Sphinx-style docstrings parser."""
    numpy = "numpy"
    """Numpydoc-style docstrings parser."""


class ObjectKind(str, Enum):
    """Enumeration of the different runtime object kinds."""

    MODULE = "module"
    """Modules."""
    CLASS = "class"
    """Classes."""
    STATICMETHOD = "staticmethod"
    """Static methods."""
    CLASSMETHOD = "classmethod"
    """Class methods."""
    METHOD_DESCRIPTOR = "method_descriptor"
    """Method descriptors."""
    METHOD = "method"
    """Methods."""
    BUILTIN_METHOD = "builtin_method"
    """Built-in methods."""
    COROUTINE = "coroutine"
    """Coroutines"""
    FUNCTION = "function"
    """Functions."""
    BUILTIN_FUNCTION = "builtin_function"
    """Built-in functions."""
    CACHED_PROPERTY = "cached_property"
    """Cached properties."""
    GETSET_DESCRIPTOR = "getset_descriptor"
    """Get/set descriptors."""
    PROPERTY = "property"
    """Properties."""
    ATTRIBUTE = "attribute"
    """Attributes."""

    def __str__(self) -> str:
        return self.value