From d30f352981d9655e223808bc3db16819fd1dc016 Mon Sep 17 00:00:00 2001 From: Juro Oravec Date: Wed, 10 Sep 2025 18:49:44 +0000 Subject: [PATCH] refactor: ruff - underscore unused vars --- docs/scripts/reference.py | 2 +- src/django_components/commands/list.py | 2 +- src/django_components/component_media.py | 2 +- src/django_components/tag_formatter.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/scripts/reference.py b/docs/scripts/reference.py index 90bb52cf..ca09a386 100644 --- a/docs/scripts/reference.py +++ b/docs/scripts/reference.py @@ -846,7 +846,7 @@ def _extract_property_docstrings(cls: Type) -> Dict[str, str]: - The function assumes that the class is defined at the global scope (module level) and that the body is indented with 4 spaces. """ - lines, start_line_index = inspect.getsourcelines(cls) + lines, _start_line_index = inspect.getsourcelines(cls) attrs_lines: List[str] = [] ignore = True for line in lines: diff --git a/src/django_components/commands/list.py b/src/django_components/commands/list.py index dab6b6d4..ebf2e9c1 100644 --- a/src/django_components/commands/list.py +++ b/src/django_components/commands/list.py @@ -155,7 +155,7 @@ class ComponentListCommand(ListCommand): data: List[Dict[str, Any]] = [] for component in components: full_name = get_import_path(component) - module, module_name, module_file_path = get_module_info(component) + _module, _module_name, module_file_path = get_module_info(component) # Make paths relative to CWD if module_file_path: diff --git a/src/django_components/component_media.py b/src/django_components/component_media.py index f47f74f6..af95db52 100644 --- a/src/django_components/component_media.py +++ b/src/django_components/component_media.py @@ -837,7 +837,7 @@ def _resolve_component_relative_files( component_name = comp_cls.__qualname__ # Get the full path of the file where the component was defined - module, module_name, module_file_path = get_module_info(comp_cls) + _module, module_name, module_file_path = get_module_info(comp_cls) if not module_file_path: logger.debug( f"Could not resolve the path to the file for component '{component_name}'." diff --git a/src/django_components/tag_formatter.py b/src/django_components/tag_formatter.py index f278165a..25275efe 100644 --- a/src/django_components/tag_formatter.py +++ b/src/django_components/tag_formatter.py @@ -233,7 +233,7 @@ class ComponentFormatter(TagFormatterABC): return f"end{self.tag}" def parse(self, tokens: List[str]) -> TagResult: - tag, *args = tokens + _tag, *args = tokens if not args: raise TemplateSyntaxError(f"{self.__class__.__name__}: Component tag did not receive tag name")