Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint check for params.enable_conda #2213

Merged
merged 11 commits into from
Mar 29, 2023
Next Next commit
Add failed lint condition when params.enable_conda is in a module
anoronh4 committed Mar 27, 2023
commit 671c1e59dec927fba1473a2ce29f280eb0cc3957
10 changes: 9 additions & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
@@ -257,9 +257,15 @@ def check_process_section(self, lines, fix_version, progress_bar):
self.warned.append(("process_standard_label", "Process label unspecified", self.main_nf))
for i, l in enumerate(lines):
url = None
l = l.strip(" '\"")
if _container_type(l) == "bioconda":
bioconda_packages = [b for b in l.split() if "bioconda::" in b]
l = l.strip(" '\"")
if _container_type(l) == "bioconda" or _container_type(l) == "conda":
match = re.search(r"params\.enable_conda",l)
if match is None:
self.passed.append(("deprecated_enable_conda", f"Found deprecated parameter 'params.enable_conda' in the conda definition", self.main_nf))
else:
self.failed.append(("deprecated_enable_conda", f"Deprecated parameter 'params.enable_conda' correctly not found in the conda definition", self.main_nf))
if _container_type(l) == "singularity":
# e.g. "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' :" -> v1.2.0_cv1
# e.g. "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' :" -> 0.11.9--0
@@ -518,6 +524,8 @@ def _container_type(line):
"""Returns the container type of a build."""
if re.search("bioconda::", line):
return "bioconda"
if line.startswith("conda"):
return "conda"
if line.startswith("https://containers") or line.startswith("https://depot"):
# Look for a http download URL.
# Thanks Stack Overflow for the regex: https://stackoverflow.com/a/3809435/713980