ldap-sync: fix data_yaml lint and mypy errors
MR48 ("Ensure group member lists are flattened") introduced two CI gate failures on main:
- ruff E501: the explanatory comment above the new
_flatten_string_listcall is 108 chars (> 100) - mypy invariance error: narrowing
itemtolist[str]and passing it to alist[str | list[str]]parameter fails becauselistis invariant in T
Wrap the comment to fit.
Also replace the parameter type with a recursive alias NestedStrList = list[str | NestedStrList] so the isinstance-narrowed branch can recurse without a variance violation
NOTE: We could fix this with just flattening one level of list. However, that ends up being more lines of code, so I think this approach is slightly better. The main downside is recursion is a bit confusing, but OTOH it does match the shape of the problem we're solving
Bug: T420691