refactor: ruff - underscore unused vars (#1372)

This commit is contained in:
Juro Oravec 2025-09-10 22:06:47 +02:00 committed by GitHub
parent f100cc1836
commit c5354baf4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 35 additions and 35 deletions

View file

@ -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:

View file

@ -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}'."

View file

@ -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")

View file

@ -54,7 +54,7 @@ class GenIdPatcher:
def mock_gen_id(*_args: Any, **_kwargs: Any) -> str:
self._gen_id_count += 1
return hex(self._gen_id_count)[2:]
return f"{self._gen_id_count:x}"
self._gen_id_patch = patch("django_components.util.misc.generate", side_effect=mock_gen_id)
self._gen_id_patch.start()