From 859ceab3f6297299afbf892fee6a94f1c2bcffa3 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Mon, 21 Nov 2022 17:28:24 +0100 Subject: [PATCH 1/4] delete comment --- nf_core/create.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nf_core/create.py b/nf_core/create.py index ed23c8487c..a8b44c20cf 100644 --- a/nf_core/create.py +++ b/nf_core/create.py @@ -166,10 +166,16 @@ def create_param_dict(self, name, description, author, version, template_yaml_pa param_dict["logo_dark"] = f"{param_dict['name_noslash']}_logo_dark.png" param_dict["version"] = version + config_yml = nf_core.utils.load_tools_config() + if ( + "lint" in config_yml + and "nextflow_config" in config_yml["lint"] + and "manifest.name" in config_yml["lint"]["nextflow_config"] + ): + return param_dict, skip_paths # Check that the pipeline name matches the requirements if not re.match(r"^[a-z]+$", param_dict["short_name"]): - log.error("[red]Invalid workflow name: must be lowercase without punctuation.") - sys.exit(1) + raise UserWarning("[red]Invalid workflow name: must be lowercase without punctuation.") return param_dict, skip_paths From 7f3a9edefc9c618e60c6c5ab18486b338e4f04f5 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Mon, 21 Nov 2022 17:31:04 +0100 Subject: [PATCH 2/4] modify changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07000cce58..aa20e20e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ ### Linting +- Don't lint pipeline name if `manifest.name` in `.nf-core.yml` ([#2035](https://github.com/nf-core/tools/pull/2035)) + ### General - Refactor CLI flag `--hide-progress` to be at the top-level group, like `--verbose` ([#2016](https://github.com/nf-core/tools/pull/2016)) From d376411fed96895fbe7e383ab637162d77652edd Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 22 Nov 2022 09:47:46 +0100 Subject: [PATCH 3/4] linting --- nf_core/components/update.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nf_core/components/update.py b/nf_core/components/update.py index ac9bb5d936..4a8420ccb9 100644 --- a/nf_core/components/update.py +++ b/nf_core/components/update.py @@ -146,6 +146,9 @@ def update(self, component=None, silent=False, updated=None, check_diff_exist=Tr exit_value = True all_patches_successful = True for modules_repo, component, sha, patch_relpath in components_info: + if component is None: + # The entry from .nf-core.yml is set to false, skip update of this component + continue component_fullname = str(Path(self.component_type, modules_repo.repo_path, component)) # Are we updating the files in place or not? dry_run = self.show_diff or self.save_diff_fn @@ -386,12 +389,13 @@ def get_single_component_info(self, component): config_entry = self.update_config[self.modules_repo.remote_url][install_dir].get(component) if config_entry is not None and config_entry is not True: if config_entry is False: - raise UserWarning( - f"{self.component_type[:-1].title()}'s update entry in '.nf-core.yml' is set to False" + log.warn( + f"{self.component_type[:-1].title()}'s update entry in '.nf-core.yml' for '{component}' is set to False" ) + return (self.modules_repo, None, None, None) if not isinstance(config_entry, str): raise UserWarning( - f"{self.component_type[:-1].title()}'s update entry in '.nf-core.yml' is of wrong type" + f"{self.component_type[:-1].title()}'s update entry in '.nf-core.yml' for '{component}' is of wrong type" ) sha = config_entry From b6b8555393af17ce919b4b077da30cd860c6da81 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 22 Nov 2022 10:10:04 +0100 Subject: [PATCH 4/4] linting --- nf_core/components/update.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nf_core/components/update.py b/nf_core/components/update.py index 4a8420ccb9..3e2130e022 100644 --- a/nf_core/components/update.py +++ b/nf_core/components/update.py @@ -381,6 +381,19 @@ def get_single_component_info(self, component): sha = self.sha config_entry = None + if any( + [ + entry.count("/") == 1 + and (entry.endswith("modules") or entry.endswith("subworkflows")) + and not (entry.endswith(".git") or entry.endswith(".git/")) + for entry in self.update_config.keys() + ] + ): + raise UserWarning( + "Your '.nf-core.yml' file format is outdated. " + "The format should be of the form:\n" + "update:\n :\n :\n :" + ) if isinstance(self.update_config.get(self.modules_repo.remote_url, {}), str): # If the repo entry is a string, it's the sha to update to config_entry = self.update_config.get(self.modules_repo.remote_url, {})