Skip to content

refactor(facades): add missing type parameters to generic functions#1759

Open
edward-ly wants to merge 1 commit into
masterfrom
refactor/noid/ruff-UP047
Open

refactor(facades): add missing type parameters to generic functions#1759
edward-ly wants to merge 1 commit into
masterfrom
refactor/noid/ruff-UP047

Conversation

@edward-ly
Copy link
Copy Markdown
Collaborator

Needed before updating pre-commit hooks (e.g. in #1678). This PR resolves the following errors in recent versions of ruff:

UP047 Generic function `flatmap` should use type parameters
  --> nextcloudappstore/core/facades.py:69:5
   |
69 | def flatmap(f: Callable[[T], Iterable[U]], xs: Iterable[T]) -> Iterable[U]:
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70 |     return chain.from_iterable(map(f, xs))
   |
help: Use type parameters

UP047 Generic function `all_match` should use type parameters
  --> nextcloudappstore/core/facades.py:73:5
   |
73 | def all_match(predicate: Callable[[T], bool], iterable: Iterable[T]) -> bool:
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 |     """
75 |     :param predicate: function to test items
   |
help: Use type parameters

UP047 Generic function `distinct` should use type parameters
  --> nextcloudappstore/core/facades.py:82:5
   |
82 | def distinct(iterable: Iterable[T], criteria: Callable[[T], U]) -> Iterable[T]:
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |     """
84 |     :param iterable:
   |
help: Use type parameters

Found 3 errors.
No fixes available (3 hidden fixes can be enabled with the `--unsafe-fixes` option).

Signed-off-by: Edward Ly <contact@edward.ly>
@edward-ly edward-ly requested a review from oleksandr-nc May 13, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant