fix(lint): resolve Ruff E701/E702 and exclude build artifacts

- Fix E701 by expanding single-line class and loop statements into blocks
- Fix E702 by splitting semicolon-separated statements
- Exclude build/, dist/, venv, and egg-info from Ruff linting
- Apply fixes consistently to source and generated files

No runtime behavior changes; lint-only cleanup to stabilize CI.

https://chatgpt.com/share/6942c9e3-80fc-800f-b471-5e1ee567f8fe
This commit is contained in:
2025-12-17 16:18:53 +01:00
parent ee3e86684a
commit ec284cc765
5 changed files with 19 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ from ansible.errors import AnsibleUndefinedVariable
try:
from ansible.utils.unsafe_proxy import AnsibleUndefined
except ImportError:
class AnsibleUndefined: pass
class AnsibleUndefined:
pass
class AppConfigKeyError(AnsibleFilterError, ValueError):
"""

View File

@@ -243,7 +243,8 @@ def _call_sound(method_name: str):
def _play_in_child(method_name: str) -> bool:
p = Process(target=_call_sound, args=(method_name,))
p.start(); p.join()
p.start()
p.join()
if p.exitcode != 0:
try:
# Sichtbare Diagnose, wenn das Kind crasht/fehlschlägt

View File

@@ -8,7 +8,8 @@ from ansible.errors import AnsibleUndefinedVariable
try:
from ansible.utils.unsafe_proxy import AnsibleUndefined
except ImportError:
class AnsibleUndefined: pass
class AnsibleUndefined:
pass
class AppConfigKeyError(AnsibleFilterError, ValueError):
"""

View File

@@ -46,3 +46,12 @@ packages = { find = { where = ["."], include = [
"__pycache__*",
] } }
include-package-data = true
[tool.ruff]
exclude = [
"build",
"dist",
"*.egg-info",
".venv",
"venv",
]

View File

@@ -4,9 +4,11 @@ def cdn_dirs(tree):
out = set()
def walk(v):
if isinstance(v, dict):
for x in v.values(): walk(x)
for x in v.values():
walk(x)
elif isinstance(v, list):
for x in v: walk(x)
for x in v:
walk(x)
elif isinstance(v, str) and os.path.isabs(v):
out.add(v)
walk(tree)