Skip to content

Commit

Permalink
Fix list_listers alias definition to appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jun 7, 2024
1 parent 6453707 commit 8beef0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/galaxy/tool_util/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,21 @@ def name(cls) -> str:
"""
return cls.__name__

@classmethod
def list_linters(cls) -> List[str]:
"""
list the names of all linter derived from Linter
"""
submodules.import_submodules(galaxy.tool_util.linters)
return [s.__name__ for s in cls.__subclasses__()]

list_listers = list_linters # deprecated alias
list_listers: Callable[[], List[str]] # deprecated alias


Linter.list_listers = classmethod(Linter.list_listers)
# Define the `list_listers` alias outside of the `Linter` class so that
# @classmethod's change to `list_linters`s signature has taken effect and mypy
# doesn't report an [assignment] error
Linter.list_listers = Linter.list_linters


class LintMessage:
Expand Down

0 comments on commit 8beef0b

Please sign in to comment.