Coverage for packages / griffelib / src / griffe / _internal / enumerations.py: 100.00%
159 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-11 11:48 +0100
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-11 11:48 +0100
1# This module contains all the enumerations of the package.
3from __future__ import annotations
5from enum import Enum
8class LogLevel(str, Enum):
9 """Enumeration of available log levels."""
11 trace = "trace"
12 """The TRACE log level."""
13 debug = "debug"
14 """The DEBUG log level."""
15 info = "info"
16 """The INFO log level."""
17 success = "success"
18 """The SUCCESS log level."""
19 warning = "warning"
20 """The WARNING log level."""
21 error = "error"
22 """The ERROR log level."""
23 critical = "critical"
24 """The CRITICAL log level."""
27class DocstringSectionKind(str, Enum):
28 """Enumeration of the possible docstring section kinds."""
30 text = "text"
31 """Text section."""
32 parameters = "parameters"
33 """Parameters section."""
34 other_parameters = "other parameters"
35 """Other parameters (keyword arguments) section."""
36 type_parameters = "type parameters"
37 """Type parameters section."""
38 raises = "raises"
39 """Raises (exceptions) section."""
40 warns = "warns"
41 """Warnings section."""
42 returns = "returns"
43 """Returned value(s) section."""
44 yields = "yields"
45 """Yielded value(s) (generators) section."""
46 receives = "receives"
47 """Received value(s) (generators) section."""
48 examples = "examples"
49 """Examples section."""
50 attributes = "attributes"
51 """Attributes section."""
52 functions = "functions"
53 """Functions section."""
54 classes = "classes"
55 """Classes section."""
56 type_aliases = "type aliases"
57 """Type aliases section."""
58 modules = "modules"
59 """Modules section."""
60 deprecated = "deprecated"
61 """Deprecation section."""
62 admonition = "admonition"
63 """Admonition block."""
66class ParameterKind(str, Enum):
67 """Enumeration of the different parameter kinds."""
69 positional_only = "positional-only"
70 """Positional-only parameter."""
71 positional_or_keyword = "positional or keyword"
72 """Positional or keyword parameter."""
73 var_positional = "variadic positional"
74 """Variadic positional parameter."""
75 keyword_only = "keyword-only"
76 """Keyword-only parameter."""
77 var_keyword = "variadic keyword"
78 """Variadic keyword parameter."""
81class TypeParameterKind(str, Enum):
82 """Enumeration of the different type parameter kinds."""
84 type_var = "type-var"
85 """Type variable."""
86 type_var_tuple = "type-var-tuple"
87 """Type variable tuple."""
88 param_spec = "param-spec"
89 """Parameter specification variable."""
92class Kind(str, Enum):
93 """Enumeration of the different object kinds."""
95 MODULE = "module"
96 """Modules."""
97 CLASS = "class"
98 """Classes."""
99 FUNCTION = "function"
100 """Functions and methods."""
101 ATTRIBUTE = "attribute"
102 """Attributes and properties."""
103 ALIAS = "alias"
104 """Aliases (imported objects)."""
105 TYPE_ALIAS = "type alias"
106 """Type aliases."""
109class ExplanationStyle(str, Enum):
110 """Enumeration of the possible styles for explanations."""
112 ONE_LINE = "oneline"
113 """Explanations on one-line."""
114 VERBOSE = "verbose"
115 """Explanations on multiple lines."""
116 MARKDOWN = "markdown"
117 """Explanations in Markdown, adapted to changelogs."""
118 GITHUB = "github"
119 """Explanation as GitHub workflow commands warnings, adapted to CI."""
122class BreakageKind(str, Enum):
123 """Enumeration of the possible API breakages."""
125 PARAMETER_MOVED = "Positional parameter was moved"
126 """Positional parameter was moved"""
127 PARAMETER_REMOVED = "Parameter was removed"
128 """Parameter was removed"""
129 PARAMETER_CHANGED_KIND = "Parameter kind was changed"
130 """Parameter kind was changed"""
131 PARAMETER_CHANGED_DEFAULT = "Parameter default was changed"
132 """Parameter default was changed"""
133 PARAMETER_CHANGED_REQUIRED = "Parameter is now required"
134 """Parameter is now required"""
135 PARAMETER_ADDED_REQUIRED = "Parameter was added as required"
136 """Parameter was added as required"""
137 RETURN_CHANGED_TYPE = "Return types are incompatible"
138 """Return types are incompatible"""
139 OBJECT_REMOVED = "Public object was removed"
140 """Public object was removed"""
141 OBJECT_CHANGED_KIND = "Public object points to a different kind of object"
142 """Public object points to a different kind of object"""
143 ATTRIBUTE_CHANGED_TYPE = "Attribute types are incompatible"
144 """Attribute types are incompatible"""
145 ATTRIBUTE_CHANGED_VALUE = "Attribute value was changed"
146 """Attribute value was changed"""
147 CLASS_REMOVED_BASE = "Base class was removed"
148 """Base class was removed"""
151class Parser(str, Enum):
152 """Enumeration of the different docstring parsers."""
154 auto = "auto"
155 """Infer docstring parser."""
156 google = "google"
157 """Google-style docstrings parser."""
158 sphinx = "sphinx"
159 """Sphinx-style docstrings parser."""
160 numpy = "numpy"
161 """Numpydoc-style docstrings parser."""
164class ObjectKind(str, Enum):
165 """Enumeration of the different runtime object kinds."""
167 MODULE = "module"
168 """Modules."""
169 CLASS = "class"
170 """Classes."""
171 STATICMETHOD = "staticmethod"
172 """Static methods."""
173 CLASSMETHOD = "classmethod"
174 """Class methods."""
175 METHOD_DESCRIPTOR = "method_descriptor"
176 """Method descriptors."""
177 METHOD = "method"
178 """Methods."""
179 BUILTIN_METHOD = "builtin_method"
180 """Built-in methods."""
181 COROUTINE = "coroutine"
182 """Coroutines"""
183 FUNCTION = "function"
184 """Functions."""
185 BUILTIN_FUNCTION = "builtin_function"
186 """Built-in functions."""
187 CACHED_PROPERTY = "cached_property"
188 """Cached properties."""
189 GETSET_DESCRIPTOR = "getset_descriptor"
190 """Get/set descriptors."""
191 PROPERTY = "property"
192 """Properties."""
193 TYPE_ALIAS = "type_alias"
194 """Type aliases."""
195 ATTRIBUTE = "attribute"
196 """Attributes."""
198 def __str__(self) -> str:
199 return self.value