Skip to content

Commit 85527c1

Browse files
committed
style: Format
1 parent 8338e9b commit 85527c1

4 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/_griffe/agents/nodes/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def relative_to_absolute(node: ast.ImportFrom, name: ast.alias, current_module:
2222
The absolute import path.
2323
"""
2424
level = node.level
25-
if level > 0 and current_module.is_package or current_module.is_subpackage:
25+
if (level > 0 and current_module.is_package) or current_module.is_subpackage:
2626
level -= 1
2727
while level > 0 and current_module.parent is not None:
2828
current_module = current_module.parent # type: ignore[assignment]

src/_griffe/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ def __str__(self) -> str:
212212
def __repr__(self) -> str:
213213
return f"Parameter(name={self.name!r}, annotation={self.annotation!r}, kind={self.kind!r}, default={self.default!r})"
214214

215-
def __eq__(self, __value: object) -> bool:
215+
def __eq__(self, value: object, /) -> bool:
216216
"""Parameters are equal if all their attributes except `docstring` and `function` are equal."""
217-
if not isinstance(__value, Parameter):
217+
if not isinstance(value, Parameter):
218218
return NotImplemented
219219
return (
220-
self.name == __value.name
221-
and self.annotation == __value.annotation
222-
and self.kind == __value.kind
223-
and self.default == __value.default
220+
self.name == value.name
221+
and self.annotation == value.annotation
222+
and self.kind == value.kind
223+
and self.default == value.default
224224
)
225225

226226
@property

src/griffe/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
# names = sorted(n for n in dir(griffe) if not n.startswith("_") and n not in ("annotations", "lazy_importing"))
368368
# print('__all__ = [\n "' + '",\n "'.join(names) + '",\n]')
369369
__all__ = [
370+
"DEFAULT_LOG_LEVEL",
370371
"Alias",
371372
"AliasResolutionError",
372373
"Attribute",
@@ -378,7 +379,6 @@
378379
"Class",
379380
"ClassRemovedBaseBreakage",
380381
"CyclicAliasError",
381-
"DEFAULT_LOG_LEVEL",
382382
"DataclassesExtension",
383383
"Decorator",
384384
"DelMembersMixin",
@@ -467,8 +467,8 @@
467467
"LinesCollection",
468468
"LoadableExtensionType",
469469
"LoadingError",
470-
"Logger",
471470
"LogLevel",
471+
"Logger",
472472
"Module",
473473
"ModuleFinder",
474474
"ModulesCollection",
@@ -517,8 +517,8 @@
517517
"builtin_extensions",
518518
"c3linear_merge",
519519
"check",
520-
"dump",
521520
"docstring_warning",
521+
"dump",
522522
"dynamic_import",
523523
"find_breaking_changes",
524524
"get__all__",

tests/helpers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ def clear_sys_modules(name: str | None = None) -> None:
2727
else:
2828
prefix = os.path.join(gettempdir(), _TMPDIR_PREFIX) # noqa: PTH118
2929
for module_name, module in tuple(sys.modules.items()):
30-
if (
31-
(file := getattr(module, "__file__", ""))
32-
and file.startswith(prefix)
33-
or (paths := getattr(module, "__path__", ()))
34-
and any(path.startswith(prefix) for path in paths)
30+
if ((file := getattr(module, "__file__", "")) and file.startswith(prefix)) or (
31+
(paths := getattr(module, "__path__", ())) and any(path.startswith(prefix) for path in paths)
3532
):
3633
sys.modules.pop(module_name, None)

0 commit comments

Comments
 (0)