|
5 | 5 | from typing import Optional, Union |
6 | 6 |
|
7 | 7 | from nf_core.pipelines.schema import PipelineSchema |
| 8 | +from nf_core.utils import load_tools_config |
8 | 9 |
|
9 | 10 | log = logging.getLogger(__name__) |
10 | 11 |
|
@@ -255,30 +256,35 @@ def nextflow_config(self) -> dict[str, list[str]]: |
255 | 256 | else: |
256 | 257 | failed.append(f"Config ``{k}`` did not have correct value: ``{self.nf_config.get(k)}``") |
257 | 258 |
|
| 259 | + _, nf_core_yaml_config = load_tools_config(self.wf_path) |
| 260 | + org_name = "nf-core" |
| 261 | + if nf_core_yaml_config and getattr(nf_core_yaml_config, "template", None): |
| 262 | + org_name = getattr(nf_core_yaml_config.template, "org", org_name) or org_name |
| 263 | + |
258 | 264 | if "manifest.name" not in ignore_configs: |
259 | 265 | # Check that the pipeline name starts with nf-core |
260 | 266 | try: |
261 | 267 | manifest_name = self.nf_config.get("manifest.name", "").strip("'\"") |
262 | | - if not manifest_name.startswith("nf-core/"): |
| 268 | + if not manifest_name.startswith(f"{org_name}/"): |
263 | 269 | raise AssertionError() |
264 | 270 | except (AssertionError, IndexError): |
265 | | - failed.append(f"Config ``manifest.name`` did not begin with ``nf-core/``:\n {manifest_name}") |
| 271 | + failed.append(f"Config ``manifest.name`` did not begin with ``{org_name}/``:\n {manifest_name}") |
266 | 272 | else: |
267 | | - passed.append("Config ``manifest.name`` began with ``nf-core/``") |
| 273 | + passed.append(f"Config ``manifest.name`` began with ``{org_name}/``") |
268 | 274 |
|
269 | 275 | if "manifest.homePage" not in ignore_configs: |
270 | 276 | # Check that the homePage is set to the GitHub URL |
271 | 277 | try: |
272 | 278 | manifest_homepage = self.nf_config.get("manifest.homePage", "").strip("'\"") |
273 | | - if not manifest_homepage.startswith("https://github.com/nf-core/"): |
| 279 | + if not manifest_homepage.startswith(f"https://github.com/{org_name}/"): |
274 | 280 | raise AssertionError() |
275 | 281 | except (AssertionError, IndexError): |
276 | 282 | failed.append( |
277 | | - f"Config variable ``manifest.homePage`` did not begin with https://github.com/nf-core/:\n {manifest_homepage}" |
| 283 | + f"Config variable ``manifest.homePage`` did not begin with https://github.com/{org_name}/:\n {manifest_homepage}" |
278 | 284 | ) |
279 | 285 |
|
280 | 286 | else: |
281 | | - passed.append("Config variable ``manifest.homePage`` began with https://github.com/nf-core/") |
| 287 | + passed.append(f"Config variable ``manifest.homePage`` began with https://github.com/{org_name}/") |
282 | 288 |
|
283 | 289 | # Check that the DAG filename ends in ``.svg`` |
284 | 290 | if "dag.file" in self.nf_config: |
|
0 commit comments