From ed5ba3bc7d55c9474bebc8cb9536245481737c4c Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 22 Nov 2022 11:21:08 +0100 Subject: [PATCH] fix sorting of component entries --- nf_core/components/info.py | 1 + nf_core/components/install.py | 2 +- nf_core/components/update.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nf_core/components/info.py b/nf_core/components/info.py index 0417b274ce..54a018dbbd 100644 --- a/nf_core/components/info.py +++ b/nf_core/components/info.py @@ -117,6 +117,7 @@ def init_mod_name(self, component): ) else: components = self.modules_repo.get_avail_components(self.component_type) + components.sort() component = questionary.autocomplete( f"Please select a {self.component_type[:-1]}", choices=components, diff --git a/nf_core/components/install.py b/nf_core/components/install.py index 4f3978be61..3770f6ac2d 100644 --- a/nf_core/components/install.py +++ b/nf_core/components/install.py @@ -186,7 +186,7 @@ def collect_and_verify_name(self, component, modules_repo): if component is None: component = questionary.autocomplete( f"{'Tool' if self.component_type == 'modules' else 'Subworkflow'} name:", - choices=modules_repo.get_avail_components(self.component_type), + choices=modules_repo.get_avail_components(self.component_type).sort(), style=nf_core.utils.nfcore_question_style, ).unsafe_ask() diff --git a/nf_core/components/update.py b/nf_core/components/update.py index ac9bb5d936..55adfdc962 100644 --- a/nf_core/components/update.py +++ b/nf_core/components/update.py @@ -353,7 +353,7 @@ def get_single_component_info(self, component): if component is None: component = questionary.autocomplete( f"{self.component_type[:-1].title()} name:", - choices=choices, + choices=choices.sort(), style=nf_core.utils.nfcore_question_style, ).unsafe_ask()