mirror of
https://github.com/django-components/django-components.git
synced 2025-11-17 21:57:07 +00:00
refactor: ruff - underscore unused vars (#1372)
This commit is contained in:
parent
f100cc1836
commit
c5354baf4f
10 changed files with 35 additions and 35 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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}'."
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue