refact: enable ruff preview rules

This commit is contained in:
sebthom
2025-04-28 00:33:58 +02:00
parent f98251ade3
commit bda0acf943
9 changed files with 70 additions and 59 deletions

View File

@@ -380,7 +380,7 @@ class TestAdExtractorContent:
):
try:
info = await test_extractor._extract_ad_page_info("/some/dir", 12345)
assert info["description"] == ""
assert not info["description"]
except TimeoutError:
# This is also acceptable - depends on how we want to handle timeouts
pass

View File

@@ -257,7 +257,7 @@ def _find_translation(translations:TranslationDict,
return bool(translations.get(module, {}).get(function, {}).get(message))
# Add kleinanzeigen_bot/ prefix if not present
module_path = f'kleinanzeigen_bot/{module}' if not module.startswith("kleinanzeigen_bot/") else module
module_path = f"kleinanzeigen_bot/{module}" if not module.startswith("kleinanzeigen_bot/") else module
# Check if module exists in translations
module_trans = translations.get(module_path, {})
@@ -301,7 +301,7 @@ def _message_exists_in_code(code_messages:dict[str, MessageDict],
# Remove kleinanzeigen_bot/ prefix if present for code message lookup
module_path = module[len("kleinanzeigen_bot/"):] if module.startswith("kleinanzeigen_bot/") else module
module_path = f'kleinanzeigen_bot/{module_path}'
module_path = f"kleinanzeigen_bot/{module_path}"
# Check if module exists in code messages
module_msgs = code_messages.get(module_path)