We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Lint for custom configs
At the moment, lint tests pass even when there is no mention of nf-core/configs. We should probably ensure that pipelines are pulling these profiles in.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `nf_core/lint/nextflow_config.py`
Content:
```
1 #!/usr/bin/env python
2 
3 import re
4 
5 
6 def nextflow_config(self):
7     """Checks the pipeline configuration for required variables.
8 
9     All nf-core pipelines are required to be configured with a minimal set of variable
10     names. This test fails or throws warnings if required variables are not set.
11 
12     .. note:: These config variables must be set in ``nextflow.config`` or another config
13               file imported from there. Any variables set in nextflow script files (eg. ``main.nf``)
14               are not checked and will be assumed to be missing.
15 
16     **The following variables fail the test if missing:**
17 
18     * ``params.outdir``: A directory in which all pipeline results should be saved
19     * ``manifest.name``: The pipeline name. Should begin with ``nf-core/``
20     * ``manifest.description``: A description of the pipeline
21     * ``manifest.version``
22 
23       * The version of this pipeline. This should correspond to a `GitHub release <https://help.github.com/articles/creating-releases/>`_.
24       * If ``--release`` is set when running ``nf-core lint``, the version number must not contain the string ``dev``
25       * If ``--release`` is _not_ set, the version should end in ``dev`` (warning triggered if not)
26 
27     * ``manifest.nextflowVersion``
28 
29       * The minimum version of Nextflow required to run the pipeline.
30       * Should be ``>=`` or ``!>=`` and a version number, eg. ``manifest.nextflowVersion = '>=0.31.0'`` (see `Nextflow documentation <https://www.nextflow.io/docs/latest/config.html#scope-manifest>`_)
31       * ``>=`` warns about old versions but tries to run anyway, ``!>=`` fails for old versions. Only use the latter if you *know* that the pipeline will certainly fail before this version.
32       * This should correspond to the ``NXF_VER`` version tested by GitHub Actions.
33 
34     * ``manifest.homePage``
35 
36       * The homepage for the pipeline. Should be the nf-core GitHub repository URL,
37         so beginning with ``https://github.com/nf-core/``
38 
39     * ``timeline.enabled``, ``trace.enabled``, ``report.enabled``, ``dag.enabled``
40 
41       * The nextflow timeline, trace, report and DAG should be enabled by default (set to ``true``)
42 
43     * ``process.cpus``, ``process.memory``, ``process.time``
44 
45       * Default CPUs, memory and time limits for tasks
46 
47     * ``params.input``
48 
49       * Input parameter to specify input data, specify this to avoid a warning
50       * Typical usage:
51 
52         * ``params.input``: Input data that is not NGS sequencing data
53 
54     **The following variables throw warnings if missing:**
55 
56     * ``manifest.mainScript``: The filename of the main pipeline script (should be ``main.nf``)
57     * ``timeline.file``, ``trace.file``, ``report.file``, ``dag.file``
58 
59       * Default filenames for the timeline, trace and report
60       * The DAG file path should end with ``.svg`` (If Graphviz is not installed, Nextflow will generate a ``.dot`` file instead)
61 
62     * ``process.container``
63 
64       * Docker Hub handle for a single default container for use by all processes.
65       * Must specify a tag that matches the pipeline version number if set.
66       * If the pipeline version number contains the string ``dev``, the DockerHub tag must be ``:dev``
67 
68     **The following variables are depreciated and fail the test if they are still present:**
69 
70     * ``params.version``: The old method for specifying the pipeline version. Replaced by ``manifest.version``
71     * ``params.nf_required_version``: The old method for specifying the minimum Nextflow version. Replaced by ``manifest.nextflowVersion``
72     * ``params.container``: The old method for specifying the dockerhub container address. Replaced by ``process.container``
73     * ``igenomesIgnore``: Changed to ``igenomes_ignore``
74 
75         .. tip:: The ``snake_case`` convention should now be used when defining pipeline parameters
76 
77     **The following Nextflow syntax is depreciated and fails the test if present:**
78 
79     * Process-level configuration syntax still using the old Nextflow syntax, for example: ``process.$fastqc`` instead of ``process withName:'fastqc'``.
80 
81     .. tip:: You can choose to ignore tests for the presence or absence of specific config variables
82              by creating a file called ``.nf-core-lint.yml`` in the root of your pipeline and creating
83              a list the config variables that should be ignored. For example:
84 
85              .. code-block:: yaml
86 
87                 nextflow_config:
88                     - params.input
89 
90              The other checks in this test (depreciated syntax etc) can not be individually identified,
91              but you can skip the entire test block if you wish:
92 
93              .. code-block:: yaml
94 
95                 nextflow_config: False
96     """
97     passed = []
98     warned = []
99     failed = []
100     ignored = []
101 
102     # Fail tests if these are missing
103     config_fail = [
104         ["manifest.name"],
105         ["manifest.nextflowVersion"],
106         ["manifest.description"],
107         ["manifest.version"],
108         ["manifest.homePage"],
109         ["timeline.enabled"],
110         ["trace.enabled"],
111         ["report.enabled"],
112         ["dag.enabled"],
113         ["process.cpus"],
114         ["process.memory"],
115         ["process.time"],
116         ["params.outdir"],
117         ["params.input"],
118     ]
119     # Throw a warning if these are missing
120     config_warn = [
121         ["manifest.mainScript"],
122         ["timeline.file"],
123         ["trace.file"],
124         ["report.file"],
125         ["dag.file"],
126         ["process.container"],
127     ]
128     # Old depreciated vars - fail if present
129     config_fail_ifdefined = [
130         "params.version",
131         "params.nf_required_version",
132         "params.container",
133         "params.singleEnd",
134         "params.igenomesIgnore",
135         "params.name",
136     ]
137 
138     # Remove field that should be ignored according to the linting config
139     ignore_configs = self.lint_config.get("nextflow_config", [])
140 
141     for cfs in config_fail:
142         for cf in cfs:
143             if cf in ignore_configs:
144                 ignored.append("Config variable ignored: {}".format(self._wrap_quotes(cf)))
145                 break
146             if cf in self.nf_config.keys():
147                 passed.append("Config variable found: {}".format(self._wrap_quotes(cf)))
148                 break
149         else:
150             failed.append("Config variable not found: {}".format(self._wrap_quotes(cfs)))
151     for cfs in config_warn:
152         for cf in cfs:
153             if cf in ignore_configs:
154                 ignored.append("Config variable ignored: {}".format(self._wrap_quotes(cf)))
155                 break
156             if cf in self.nf_config.keys():
157                 passed.append("Config variable found: {}".format(self._wrap_quotes(cf)))
158                 break
159         else:
160             warned.append("Config variable not found: {}".format(self._wrap_quotes(cfs)))
161     for cf in config_fail_ifdefined:
162         if cf in ignore_configs:
163             ignored.append("Config variable ignored: {}".format(self._wrap_quotes(cf)))
164             break
165         if cf not in self.nf_config.keys():
166             passed.append("Config variable (correctly) not found: {}".format(self._wrap_quotes(cf)))
167         else:
168             failed.append("Config variable (incorrectly) found: {}".format(self._wrap_quotes(cf)))
169 
170     # Check and warn if the process configuration is done with deprecated syntax
171     process_with_deprecated_syntax = list(
172         set(
173             [
174                 re.search(r"^(process\.\$.*?)\.+.*$", ck).group(1)
175                 for ck in self.nf_config.keys()
176                 if re.match(r"^(process\.\$.*?)\.+.*$", ck)
177             ]
178         )
179     )
180     for pd in process_with_deprecated_syntax:
181         warned.append("Process configuration is done with deprecated_syntax: {}".format(pd))
182 
183     # Check the variables that should be set to 'true'
184     for k in ["timeline.enabled", "report.enabled", "trace.enabled", "dag.enabled"]:
185         if self.nf_config.get(k) == "true":
186             passed.append("Config ``{}`` had correct value: ``{}``".format(k, self.nf_config.get(k)))
187         else:
188             failed.append("Config ``{}`` did not have correct value: ``{}``".format(k, self.nf_config.get(k)))
189 
190     # Check that the pipeline name starts with nf-core
191     try:
192         assert self.nf_config.get("manifest.name", "").strip("'\"").startswith("nf-core/")
193     except (AssertionError, IndexError):
194         failed.append(
195             "Config ``manifest.name`` did not begin with ``nf-core/``:\n    {}".format(
196                 self.nf_config.get("manifest.name", "").strip("'\"")
197             )
198         )
199     else:
200         passed.append("Config ``manifest.name`` began with ``nf-core/``")
201 
202     # Check that the homePage is set to the GitHub URL
203     try:
204         assert self.nf_config.get("manifest.homePage", "").strip("'\"").startswith("https://github.com/nf-core/")
205     except (AssertionError, IndexError):
206         failed.append(
207             "Config variable ``manifest.homePage`` did not begin with https://github.com/nf-core/:\n    {}".format(
208                 self.nf_config.get("manifest.homePage", "").strip("'\"")
209             )
210         )
211     else:
212         passed.append("Config variable ``manifest.homePage`` began with https://github.com/nf-core/")
213 
214     # Check that the DAG filename ends in ``.svg``
215     if "dag.file" in self.nf_config:
216         if self.nf_config["dag.file"].strip("'\"").endswith(".svg"):
217             passed.append("Config ``dag.file`` ended with ``.svg``")
218         else:
219             failed.append("Config ``dag.file`` did not end with ``.svg``")
220 
221     # Check that the minimum nextflowVersion is set properly
222     if "manifest.nextflowVersion" in self.nf_config:
223         if self.nf_config.get("manifest.nextflowVersion", "").strip("\"'").lstrip("!").startswith(">="):
224             passed.append("Config variable ``manifest.nextflowVersion`` started with >= or !>=")
225         else:
226             failed.append(
227                 "Config ``manifest.nextflowVersion`` did not start with ``>=`` or ``!>=`` : ``{}``".format(
228                     self.nf_config.get("manifest.nextflowVersion", "")
229                 ).strip("\"'")
230             )
231 
232     # Check that the process.container name is pulling the version tag or :dev
233     if self.nf_config.get("process.container"):
234         container_name = "{}:{}".format(
235             self.nf_config.get("manifest.name").replace("nf-core", "nfcore").strip("'"),
236             self.nf_config.get("manifest.version", "").strip("'"),
237         )
238         if "dev" in self.nf_config.get("manifest.version", "") or not self.nf_config.get("manifest.version"):
239             container_name = "{}:dev".format(
240                 self.nf_config.get("manifest.name").replace("nf-core", "nfcore").strip("'")
241             )
242         try:
243             assert self.nf_config.get("process.container", "").strip("'") == container_name
244         except AssertionError:
245             if self.release_mode:
246                 failed.append(
247                     "Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``".format(
248                         container_name, self.nf_config.get("process.container", "").strip("'")
249                     )
250                 )
251             else:
252                 warned.append(
253                     "Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``".format(
254                         container_name, self.nf_config.get("process.container", "").strip("'")
255                     )
256                 )
257         else:
258             passed.append("Config ``process.container`` looks correct: ``{}``".format(container_name))
259 
260     # Check that the pipeline version contains ``dev``
261     if not self.release_mode and "manifest.version" in self.nf_config:
262         if self.nf_config["manifest.version"].strip(" '\"").endswith("dev"):
263             passed.append(
264                 "Config ``manifest.version`` ends in ``dev``: ``{}``".format(self.nf_config["manifest.version"])
265             )
266         else:
267             warned.append(
268                 "Config ``manifest.version`` should end in ``dev``: ``{}``".format(self.nf_config["manifest.version"])
269             )
270     elif "manifest.version" in self.nf_config:
271         if "dev" in self.nf_config["manifest.version"]:
272             failed.append(
273                 "Config ``manifest.version`` should not contain ``dev`` for a release: ``{}``".format(
274                     self.nf_config["manifest.version"]
275                 )
276             )
277         else:
278             passed.append(
279                 "Config ``manifest.version`` does not contain ``dev`` for release: ``{}``".format(
280                     self.nf_config["manifest.version"]
281                 )
282             )
283 
284     return {"passed": passed, "warned": warned, "failed": failed, "ignored": ignored}
285
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/nf_core/lint/nextflow_config.py b/nf_core/lint/nextflow_config.py
--- a/nf_core/lint/nextflow_config.py
+++ b/nf_core/lint/nextflow_config.py
@@ -1,6 +1,10 @@
 #!/usr/bin/env python
 
 import re
+import os
+import logging
+
+log = logging.getLogger(__name__)
 
 
 def nextflow_config(self):
@@ -51,6 +55,23 @@
 
         * ``params.input``: Input data that is not NGS sequencing data
 
+    * ``params.custom_config_version``
+
+        * Should always be set to default value ``master``
+
+    * ``params.custom_config_base``
+
+        * Should always be set to default value:
+        ``https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}``
+
+    * ``params.show_hidden_params``
+
+        * Determines whether boilerplate params are showed by schema. Set to ``false`` by default
+
+    * ``params.schema_ignore_params``
+
+        * A comma separated string of inputs the schema validation should ignore.
+
     **The following variables throw warnings if missing:**
 
     * ``manifest.mainScript``: The filename of the main pipeline script (should be ``main.nf``)
@@ -115,6 +136,8 @@
         ["process.time"],
         ["params.outdir"],
         ["params.input"],
+        ["params.show_hidden_params"],
+        ["params.schema_ignore_params"],
     ]
     # Throw a warning if these are missing
     config_warn = [
@@ -281,4 +304,46 @@
                 )
             )
 
+    # Check if custom profile params are set correctly
+    if self.nf_config.get("params.custom_config_version", "").strip("'") == "master":
+        passed.append("Config `params.custom_config_version` is set to `master`")
+    else:
+        failed.append("Config `params.custom_config_version` is not set to `master`")
+
+    custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/{}".format(
+        self.nf_config.get("params.custom_config_version", "").strip("'")
+    )
+    if self.nf_config.get("params.custom_config_base", "").strip("'") == custom_config_base:
+        passed.append("Config `params.custom_config_base` is set to `{}`".format(custom_config_base))
+    else:
+        failed.append("Config `params.custom_config_base` is not set to `{}`".format(custom_config_base))
+
+    # Check that lines for loading custom profiles exist
+    lines = [
+        r"// Load nf-core custom profiles from different Institutions",
+        r"try {",
+        r'includeConfig "${params.custom_config_base}/nfcore_custom.config"',
+        r"} catch (Exception e) {",
+        r'System.err.println("WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config")',
+        r"}",
+    ]
+    path = os.path.join(self.wf_path, "nextflow.config")
+    i = 0
+    with open(path, "r") as f:
+        for line in f:
+            if lines[i] in line:
+                i += 1
+                if i == len(lines):
+                    break
+            else:
+                i = 0
+    if i == len(lines):
+        passed.append("Lines for loading custom profiles found")
+    else:
+        lines[2] = f"\t{lines[2]}"
+        lines[4] = f"\t{lines[4]}"
+        failed.append(
+            "Lines for loading custom profiles not found. File should contain: ```groovy\n{}".format("\n".join(lines))
+        )
+
     return {"passed": passed, "warned": warned, "failed": failed, "ignored": ignored}

{"golden_diff": "diff --git a/nf_core/lint/nextflow_config.py b/nf_core/lint/nextflow_config.py\n--- a/nf_core/lint/nextflow_config.py\n+++ b/nf_core/lint/nextflow_config.py\n@@ -1,6 +1,10 @@\n #!/usr/bin/env python\n \n import re\n+import os\n+import logging\n+\n+log = logging.getLogger(__name__)\n \n \n def nextflow_config(self):\n@@ -51,6 +55,23 @@\n \n         * ``params.input``: Input data that is not NGS sequencing data\n \n+    * ``params.custom_config_version``\n+\n+        * Should always be set to default value ``master``\n+\n+    * ``params.custom_config_base``\n+\n+        * Should always be set to default value:\n+        ``https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}``\n+\n+    * ``params.show_hidden_params``\n+\n+        * Determines whether boilerplate params are showed by schema. Set to ``false`` by default\n+\n+    * ``params.schema_ignore_params``\n+\n+        * A comma separated string of inputs the schema validation should ignore.\n+\n     **The following variables throw warnings if missing:**\n \n     * ``manifest.mainScript``: The filename of the main pipeline script (should be ``main.nf``)\n@@ -115,6 +136,8 @@\n         [\"process.time\"],\n         [\"params.outdir\"],\n         [\"params.input\"],\n+        [\"params.show_hidden_params\"],\n+        [\"params.schema_ignore_params\"],\n     ]\n     # Throw a warning if these are missing\n     config_warn = [\n@@ -281,4 +304,46 @@\n                 )\n             )\n \n+    # Check if custom profile params are set correctly\n+    if self.nf_config.get(\"params.custom_config_version\", \"\").strip(\"'\") == \"master\":\n+        passed.append(\"Config `params.custom_config_version` is set to `master`\")\n+    else:\n+        failed.append(\"Config `params.custom_config_version` is not set to `master`\")\n+\n+    custom_config_base = \"https://raw.githubusercontent.com/nf-core/configs/{}\".format(\n+        self.nf_config.get(\"params.custom_config_version\", \"\").strip(\"'\")\n+    )\n+    if self.nf_config.get(\"params.custom_config_base\", \"\").strip(\"'\") == custom_config_base:\n+        passed.append(\"Config `params.custom_config_base` is set to `{}`\".format(custom_config_base))\n+    else:\n+        failed.append(\"Config `params.custom_config_base` is not set to `{}`\".format(custom_config_base))\n+\n+    # Check that lines for loading custom profiles exist\n+    lines = [\n+        r\"// Load nf-core custom profiles from different Institutions\",\n+        r\"try {\",\n+        r'includeConfig \"${params.custom_config_base}/nfcore_custom.config\"',\n+        r\"} catch (Exception e) {\",\n+        r'System.err.println(\"WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config\")',\n+        r\"}\",\n+    ]\n+    path = os.path.join(self.wf_path, \"nextflow.config\")\n+    i = 0\n+    with open(path, \"r\") as f:\n+        for line in f:\n+            if lines[i] in line:\n+                i += 1\n+                if i == len(lines):\n+                    break\n+            else:\n+                i = 0\n+    if i == len(lines):\n+        passed.append(\"Lines for loading custom profiles found\")\n+    else:\n+        lines[2] = f\"\\t{lines[2]}\"\n+        lines[4] = f\"\\t{lines[4]}\"\n+        failed.append(\n+            \"Lines for loading custom profiles not found. File should contain: ```groovy\\n{}\".format(\"\\n\".join(lines))\n+        )\n+\n     return {\"passed\": passed, \"warned\": warned, \"failed\": failed, \"ignored\": ignored}\n", "issue": "Lint for custom configs\nAt the moment, lint tests pass even when there is no mention of nf-core/configs. We should probably ensure that pipelines are pulling these profiles in.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport re\n\n\ndef nextflow_config(self):\n    \"\"\"Checks the pipeline configuration for required variables.\n\n    All nf-core pipelines are required to be configured with a minimal set of variable\n    names. This test fails or throws warnings if required variables are not set.\n\n    .. note:: These config variables must be set in ``nextflow.config`` or another config\n              file imported from there. Any variables set in nextflow script files (eg. ``main.nf``)\n              are not checked and will be assumed to be missing.\n\n    **The following variables fail the test if missing:**\n\n    * ``params.outdir``: A directory in which all pipeline results should be saved\n    * ``manifest.name``: The pipeline name. Should begin with ``nf-core/``\n    * ``manifest.description``: A description of the pipeline\n    * ``manifest.version``\n\n      * The version of this pipeline. This should correspond to a `GitHub release <https://help.github.com/articles/creating-releases/>`_.\n      * If ``--release`` is set when running ``nf-core lint``, the version number must not contain the string ``dev``\n      * If ``--release`` is _not_ set, the version should end in ``dev`` (warning triggered if not)\n\n    * ``manifest.nextflowVersion``\n\n      * The minimum version of Nextflow required to run the pipeline.\n      * Should be ``>=`` or ``!>=`` and a version number, eg. ``manifest.nextflowVersion = '>=0.31.0'`` (see `Nextflow documentation <https://www.nextflow.io/docs/latest/config.html#scope-manifest>`_)\n      * ``>=`` warns about old versions but tries to run anyway, ``!>=`` fails for old versions. Only use the latter if you *know* that the pipeline will certainly fail before this version.\n      * This should correspond to the ``NXF_VER`` version tested by GitHub Actions.\n\n    * ``manifest.homePage``\n\n      * The homepage for the pipeline. Should be the nf-core GitHub repository URL,\n        so beginning with ``https://github.com/nf-core/``\n\n    * ``timeline.enabled``, ``trace.enabled``, ``report.enabled``, ``dag.enabled``\n\n      * The nextflow timeline, trace, report and DAG should be enabled by default (set to ``true``)\n\n    * ``process.cpus``, ``process.memory``, ``process.time``\n\n      * Default CPUs, memory and time limits for tasks\n\n    * ``params.input``\n\n      * Input parameter to specify input data, specify this to avoid a warning\n      * Typical usage:\n\n        * ``params.input``: Input data that is not NGS sequencing data\n\n    **The following variables throw warnings if missing:**\n\n    * ``manifest.mainScript``: The filename of the main pipeline script (should be ``main.nf``)\n    * ``timeline.file``, ``trace.file``, ``report.file``, ``dag.file``\n\n      * Default filenames for the timeline, trace and report\n      * The DAG file path should end with ``.svg`` (If Graphviz is not installed, Nextflow will generate a ``.dot`` file instead)\n\n    * ``process.container``\n\n      * Docker Hub handle for a single default container for use by all processes.\n      * Must specify a tag that matches the pipeline version number if set.\n      * If the pipeline version number contains the string ``dev``, the DockerHub tag must be ``:dev``\n\n    **The following variables are depreciated and fail the test if they are still present:**\n\n    * ``params.version``: The old method for specifying the pipeline version. Replaced by ``manifest.version``\n    * ``params.nf_required_version``: The old method for specifying the minimum Nextflow version. Replaced by ``manifest.nextflowVersion``\n    * ``params.container``: The old method for specifying the dockerhub container address. Replaced by ``process.container``\n    * ``igenomesIgnore``: Changed to ``igenomes_ignore``\n\n        .. tip:: The ``snake_case`` convention should now be used when defining pipeline parameters\n\n    **The following Nextflow syntax is depreciated and fails the test if present:**\n\n    * Process-level configuration syntax still using the old Nextflow syntax, for example: ``process.$fastqc`` instead of ``process withName:'fastqc'``.\n\n    .. tip:: You can choose to ignore tests for the presence or absence of specific config variables\n             by creating a file called ``.nf-core-lint.yml`` in the root of your pipeline and creating\n             a list the config variables that should be ignored. For example:\n\n             .. code-block:: yaml\n\n                nextflow_config:\n                    - params.input\n\n             The other checks in this test (depreciated syntax etc) can not be individually identified,\n             but you can skip the entire test block if you wish:\n\n             .. code-block:: yaml\n\n                nextflow_config: False\n    \"\"\"\n    passed = []\n    warned = []\n    failed = []\n    ignored = []\n\n    # Fail tests if these are missing\n    config_fail = [\n        [\"manifest.name\"],\n        [\"manifest.nextflowVersion\"],\n        [\"manifest.description\"],\n        [\"manifest.version\"],\n        [\"manifest.homePage\"],\n        [\"timeline.enabled\"],\n        [\"trace.enabled\"],\n        [\"report.enabled\"],\n        [\"dag.enabled\"],\n        [\"process.cpus\"],\n        [\"process.memory\"],\n        [\"process.time\"],\n        [\"params.outdir\"],\n        [\"params.input\"],\n    ]\n    # Throw a warning if these are missing\n    config_warn = [\n        [\"manifest.mainScript\"],\n        [\"timeline.file\"],\n        [\"trace.file\"],\n        [\"report.file\"],\n        [\"dag.file\"],\n        [\"process.container\"],\n    ]\n    # Old depreciated vars - fail if present\n    config_fail_ifdefined = [\n        \"params.version\",\n        \"params.nf_required_version\",\n        \"params.container\",\n        \"params.singleEnd\",\n        \"params.igenomesIgnore\",\n        \"params.name\",\n    ]\n\n    # Remove field that should be ignored according to the linting config\n    ignore_configs = self.lint_config.get(\"nextflow_config\", [])\n\n    for cfs in config_fail:\n        for cf in cfs:\n            if cf in ignore_configs:\n                ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n                break\n            if cf in self.nf_config.keys():\n                passed.append(\"Config variable found: {}\".format(self._wrap_quotes(cf)))\n                break\n        else:\n            failed.append(\"Config variable not found: {}\".format(self._wrap_quotes(cfs)))\n    for cfs in config_warn:\n        for cf in cfs:\n            if cf in ignore_configs:\n                ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n                break\n            if cf in self.nf_config.keys():\n                passed.append(\"Config variable found: {}\".format(self._wrap_quotes(cf)))\n                break\n        else:\n            warned.append(\"Config variable not found: {}\".format(self._wrap_quotes(cfs)))\n    for cf in config_fail_ifdefined:\n        if cf in ignore_configs:\n            ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n            break\n        if cf not in self.nf_config.keys():\n            passed.append(\"Config variable (correctly) not found: {}\".format(self._wrap_quotes(cf)))\n        else:\n            failed.append(\"Config variable (incorrectly) found: {}\".format(self._wrap_quotes(cf)))\n\n    # Check and warn if the process configuration is done with deprecated syntax\n    process_with_deprecated_syntax = list(\n        set(\n            [\n                re.search(r\"^(process\\.\\$.*?)\\.+.*$\", ck).group(1)\n                for ck in self.nf_config.keys()\n                if re.match(r\"^(process\\.\\$.*?)\\.+.*$\", ck)\n            ]\n        )\n    )\n    for pd in process_with_deprecated_syntax:\n        warned.append(\"Process configuration is done with deprecated_syntax: {}\".format(pd))\n\n    # Check the variables that should be set to 'true'\n    for k in [\"timeline.enabled\", \"report.enabled\", \"trace.enabled\", \"dag.enabled\"]:\n        if self.nf_config.get(k) == \"true\":\n            passed.append(\"Config ``{}`` had correct value: ``{}``\".format(k, self.nf_config.get(k)))\n        else:\n            failed.append(\"Config ``{}`` did not have correct value: ``{}``\".format(k, self.nf_config.get(k)))\n\n    # Check that the pipeline name starts with nf-core\n    try:\n        assert self.nf_config.get(\"manifest.name\", \"\").strip(\"'\\\"\").startswith(\"nf-core/\")\n    except (AssertionError, IndexError):\n        failed.append(\n            \"Config ``manifest.name`` did not begin with ``nf-core/``:\\n    {}\".format(\n                self.nf_config.get(\"manifest.name\", \"\").strip(\"'\\\"\")\n            )\n        )\n    else:\n        passed.append(\"Config ``manifest.name`` began with ``nf-core/``\")\n\n    # Check that the homePage is set to the GitHub URL\n    try:\n        assert self.nf_config.get(\"manifest.homePage\", \"\").strip(\"'\\\"\").startswith(\"https://github.com/nf-core/\")\n    except (AssertionError, IndexError):\n        failed.append(\n            \"Config variable ``manifest.homePage`` did not begin with https://github.com/nf-core/:\\n    {}\".format(\n                self.nf_config.get(\"manifest.homePage\", \"\").strip(\"'\\\"\")\n            )\n        )\n    else:\n        passed.append(\"Config variable ``manifest.homePage`` began with https://github.com/nf-core/\")\n\n    # Check that the DAG filename ends in ``.svg``\n    if \"dag.file\" in self.nf_config:\n        if self.nf_config[\"dag.file\"].strip(\"'\\\"\").endswith(\".svg\"):\n            passed.append(\"Config ``dag.file`` ended with ``.svg``\")\n        else:\n            failed.append(\"Config ``dag.file`` did not end with ``.svg``\")\n\n    # Check that the minimum nextflowVersion is set properly\n    if \"manifest.nextflowVersion\" in self.nf_config:\n        if self.nf_config.get(\"manifest.nextflowVersion\", \"\").strip(\"\\\"'\").lstrip(\"!\").startswith(\">=\"):\n            passed.append(\"Config variable ``manifest.nextflowVersion`` started with >= or !>=\")\n        else:\n            failed.append(\n                \"Config ``manifest.nextflowVersion`` did not start with ``>=`` or ``!>=`` : ``{}``\".format(\n                    self.nf_config.get(\"manifest.nextflowVersion\", \"\")\n                ).strip(\"\\\"'\")\n            )\n\n    # Check that the process.container name is pulling the version tag or :dev\n    if self.nf_config.get(\"process.container\"):\n        container_name = \"{}:{}\".format(\n            self.nf_config.get(\"manifest.name\").replace(\"nf-core\", \"nfcore\").strip(\"'\"),\n            self.nf_config.get(\"manifest.version\", \"\").strip(\"'\"),\n        )\n        if \"dev\" in self.nf_config.get(\"manifest.version\", \"\") or not self.nf_config.get(\"manifest.version\"):\n            container_name = \"{}:dev\".format(\n                self.nf_config.get(\"manifest.name\").replace(\"nf-core\", \"nfcore\").strip(\"'\")\n            )\n        try:\n            assert self.nf_config.get(\"process.container\", \"\").strip(\"'\") == container_name\n        except AssertionError:\n            if self.release_mode:\n                failed.append(\n                    \"Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``\".format(\n                        container_name, self.nf_config.get(\"process.container\", \"\").strip(\"'\")\n                    )\n                )\n            else:\n                warned.append(\n                    \"Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``\".format(\n                        container_name, self.nf_config.get(\"process.container\", \"\").strip(\"'\")\n                    )\n                )\n        else:\n            passed.append(\"Config ``process.container`` looks correct: ``{}``\".format(container_name))\n\n    # Check that the pipeline version contains ``dev``\n    if not self.release_mode and \"manifest.version\" in self.nf_config:\n        if self.nf_config[\"manifest.version\"].strip(\" '\\\"\").endswith(\"dev\"):\n            passed.append(\n                \"Config ``manifest.version`` ends in ``dev``: ``{}``\".format(self.nf_config[\"manifest.version\"])\n            )\n        else:\n            warned.append(\n                \"Config ``manifest.version`` should end in ``dev``: ``{}``\".format(self.nf_config[\"manifest.version\"])\n            )\n    elif \"manifest.version\" in self.nf_config:\n        if \"dev\" in self.nf_config[\"manifest.version\"]:\n            failed.append(\n                \"Config ``manifest.version`` should not contain ``dev`` for a release: ``{}``\".format(\n                    self.nf_config[\"manifest.version\"]\n                )\n            )\n        else:\n            passed.append(\n                \"Config ``manifest.version`` does not contain ``dev`` for release: ``{}``\".format(\n                    self.nf_config[\"manifest.version\"]\n                )\n            )\n\n    return {\"passed\": passed, \"warned\": warned, \"failed\": failed, \"ignored\": ignored}\n", "path": "nf_core/lint/nextflow_config.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport re\nimport os\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\ndef nextflow_config(self):\n    \"\"\"Checks the pipeline configuration for required variables.\n\n    All nf-core pipelines are required to be configured with a minimal set of variable\n    names. This test fails or throws warnings if required variables are not set.\n\n    .. note:: These config variables must be set in ``nextflow.config`` or another config\n              file imported from there. Any variables set in nextflow script files (eg. ``main.nf``)\n              are not checked and will be assumed to be missing.\n\n    **The following variables fail the test if missing:**\n\n    * ``params.outdir``: A directory in which all pipeline results should be saved\n    * ``manifest.name``: The pipeline name. Should begin with ``nf-core/``\n    * ``manifest.description``: A description of the pipeline\n    * ``manifest.version``\n\n      * The version of this pipeline. This should correspond to a `GitHub release <https://help.github.com/articles/creating-releases/>`_.\n      * If ``--release`` is set when running ``nf-core lint``, the version number must not contain the string ``dev``\n      * If ``--release`` is _not_ set, the version should end in ``dev`` (warning triggered if not)\n\n    * ``manifest.nextflowVersion``\n\n      * The minimum version of Nextflow required to run the pipeline.\n      * Should be ``>=`` or ``!>=`` and a version number, eg. ``manifest.nextflowVersion = '>=0.31.0'`` (see `Nextflow documentation <https://www.nextflow.io/docs/latest/config.html#scope-manifest>`_)\n      * ``>=`` warns about old versions but tries to run anyway, ``!>=`` fails for old versions. Only use the latter if you *know* that the pipeline will certainly fail before this version.\n      * This should correspond to the ``NXF_VER`` version tested by GitHub Actions.\n\n    * ``manifest.homePage``\n\n      * The homepage for the pipeline. Should be the nf-core GitHub repository URL,\n        so beginning with ``https://github.com/nf-core/``\n\n    * ``timeline.enabled``, ``trace.enabled``, ``report.enabled``, ``dag.enabled``\n\n      * The nextflow timeline, trace, report and DAG should be enabled by default (set to ``true``)\n\n    * ``process.cpus``, ``process.memory``, ``process.time``\n\n      * Default CPUs, memory and time limits for tasks\n\n    * ``params.input``\n\n      * Input parameter to specify input data, specify this to avoid a warning\n      * Typical usage:\n\n        * ``params.input``: Input data that is not NGS sequencing data\n\n    * ``params.custom_config_version``\n\n        * Should always be set to default value ``master``\n\n    * ``params.custom_config_base``\n\n        * Should always be set to default value:\n        ``https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}``\n\n    * ``params.show_hidden_params``\n\n        * Determines whether boilerplate params are showed by schema. Set to ``false`` by default\n\n    * ``params.schema_ignore_params``\n\n        * A comma separated string of inputs the schema validation should ignore.\n\n    **The following variables throw warnings if missing:**\n\n    * ``manifest.mainScript``: The filename of the main pipeline script (should be ``main.nf``)\n    * ``timeline.file``, ``trace.file``, ``report.file``, ``dag.file``\n\n      * Default filenames for the timeline, trace and report\n      * The DAG file path should end with ``.svg`` (If Graphviz is not installed, Nextflow will generate a ``.dot`` file instead)\n\n    * ``process.container``\n\n      * Docker Hub handle for a single default container for use by all processes.\n      * Must specify a tag that matches the pipeline version number if set.\n      * If the pipeline version number contains the string ``dev``, the DockerHub tag must be ``:dev``\n\n    **The following variables are depreciated and fail the test if they are still present:**\n\n    * ``params.version``: The old method for specifying the pipeline version. Replaced by ``manifest.version``\n    * ``params.nf_required_version``: The old method for specifying the minimum Nextflow version. Replaced by ``manifest.nextflowVersion``\n    * ``params.container``: The old method for specifying the dockerhub container address. Replaced by ``process.container``\n    * ``igenomesIgnore``: Changed to ``igenomes_ignore``\n\n        .. tip:: The ``snake_case`` convention should now be used when defining pipeline parameters\n\n    **The following Nextflow syntax is depreciated and fails the test if present:**\n\n    * Process-level configuration syntax still using the old Nextflow syntax, for example: ``process.$fastqc`` instead of ``process withName:'fastqc'``.\n\n    .. tip:: You can choose to ignore tests for the presence or absence of specific config variables\n             by creating a file called ``.nf-core-lint.yml`` in the root of your pipeline and creating\n             a list the config variables that should be ignored. For example:\n\n             .. code-block:: yaml\n\n                nextflow_config:\n                    - params.input\n\n             The other checks in this test (depreciated syntax etc) can not be individually identified,\n             but you can skip the entire test block if you wish:\n\n             .. code-block:: yaml\n\n                nextflow_config: False\n    \"\"\"\n    passed = []\n    warned = []\n    failed = []\n    ignored = []\n\n    # Fail tests if these are missing\n    config_fail = [\n        [\"manifest.name\"],\n        [\"manifest.nextflowVersion\"],\n        [\"manifest.description\"],\n        [\"manifest.version\"],\n        [\"manifest.homePage\"],\n        [\"timeline.enabled\"],\n        [\"trace.enabled\"],\n        [\"report.enabled\"],\n        [\"dag.enabled\"],\n        [\"process.cpus\"],\n        [\"process.memory\"],\n        [\"process.time\"],\n        [\"params.outdir\"],\n        [\"params.input\"],\n        [\"params.show_hidden_params\"],\n        [\"params.schema_ignore_params\"],\n    ]\n    # Throw a warning if these are missing\n    config_warn = [\n        [\"manifest.mainScript\"],\n        [\"timeline.file\"],\n        [\"trace.file\"],\n        [\"report.file\"],\n        [\"dag.file\"],\n        [\"process.container\"],\n    ]\n    # Old depreciated vars - fail if present\n    config_fail_ifdefined = [\n        \"params.version\",\n        \"params.nf_required_version\",\n        \"params.container\",\n        \"params.singleEnd\",\n        \"params.igenomesIgnore\",\n        \"params.name\",\n    ]\n\n    # Remove field that should be ignored according to the linting config\n    ignore_configs = self.lint_config.get(\"nextflow_config\", [])\n\n    for cfs in config_fail:\n        for cf in cfs:\n            if cf in ignore_configs:\n                ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n                break\n            if cf in self.nf_config.keys():\n                passed.append(\"Config variable found: {}\".format(self._wrap_quotes(cf)))\n                break\n        else:\n            failed.append(\"Config variable not found: {}\".format(self._wrap_quotes(cfs)))\n    for cfs in config_warn:\n        for cf in cfs:\n            if cf in ignore_configs:\n                ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n                break\n            if cf in self.nf_config.keys():\n                passed.append(\"Config variable found: {}\".format(self._wrap_quotes(cf)))\n                break\n        else:\n            warned.append(\"Config variable not found: {}\".format(self._wrap_quotes(cfs)))\n    for cf in config_fail_ifdefined:\n        if cf in ignore_configs:\n            ignored.append(\"Config variable ignored: {}\".format(self._wrap_quotes(cf)))\n            break\n        if cf not in self.nf_config.keys():\n            passed.append(\"Config variable (correctly) not found: {}\".format(self._wrap_quotes(cf)))\n        else:\n            failed.append(\"Config variable (incorrectly) found: {}\".format(self._wrap_quotes(cf)))\n\n    # Check and warn if the process configuration is done with deprecated syntax\n    process_with_deprecated_syntax = list(\n        set(\n            [\n                re.search(r\"^(process\\.\\$.*?)\\.+.*$\", ck).group(1)\n                for ck in self.nf_config.keys()\n                if re.match(r\"^(process\\.\\$.*?)\\.+.*$\", ck)\n            ]\n        )\n    )\n    for pd in process_with_deprecated_syntax:\n        warned.append(\"Process configuration is done with deprecated_syntax: {}\".format(pd))\n\n    # Check the variables that should be set to 'true'\n    for k in [\"timeline.enabled\", \"report.enabled\", \"trace.enabled\", \"dag.enabled\"]:\n        if self.nf_config.get(k) == \"true\":\n            passed.append(\"Config ``{}`` had correct value: ``{}``\".format(k, self.nf_config.get(k)))\n        else:\n            failed.append(\"Config ``{}`` did not have correct value: ``{}``\".format(k, self.nf_config.get(k)))\n\n    # Check that the pipeline name starts with nf-core\n    try:\n        assert self.nf_config.get(\"manifest.name\", \"\").strip(\"'\\\"\").startswith(\"nf-core/\")\n    except (AssertionError, IndexError):\n        failed.append(\n            \"Config ``manifest.name`` did not begin with ``nf-core/``:\\n    {}\".format(\n                self.nf_config.get(\"manifest.name\", \"\").strip(\"'\\\"\")\n            )\n        )\n    else:\n        passed.append(\"Config ``manifest.name`` began with ``nf-core/``\")\n\n    # Check that the homePage is set to the GitHub URL\n    try:\n        assert self.nf_config.get(\"manifest.homePage\", \"\").strip(\"'\\\"\").startswith(\"https://github.com/nf-core/\")\n    except (AssertionError, IndexError):\n        failed.append(\n            \"Config variable ``manifest.homePage`` did not begin with https://github.com/nf-core/:\\n    {}\".format(\n                self.nf_config.get(\"manifest.homePage\", \"\").strip(\"'\\\"\")\n            )\n        )\n    else:\n        passed.append(\"Config variable ``manifest.homePage`` began with https://github.com/nf-core/\")\n\n    # Check that the DAG filename ends in ``.svg``\n    if \"dag.file\" in self.nf_config:\n        if self.nf_config[\"dag.file\"].strip(\"'\\\"\").endswith(\".svg\"):\n            passed.append(\"Config ``dag.file`` ended with ``.svg``\")\n        else:\n            failed.append(\"Config ``dag.file`` did not end with ``.svg``\")\n\n    # Check that the minimum nextflowVersion is set properly\n    if \"manifest.nextflowVersion\" in self.nf_config:\n        if self.nf_config.get(\"manifest.nextflowVersion\", \"\").strip(\"\\\"'\").lstrip(\"!\").startswith(\">=\"):\n            passed.append(\"Config variable ``manifest.nextflowVersion`` started with >= or !>=\")\n        else:\n            failed.append(\n                \"Config ``manifest.nextflowVersion`` did not start with ``>=`` or ``!>=`` : ``{}``\".format(\n                    self.nf_config.get(\"manifest.nextflowVersion\", \"\")\n                ).strip(\"\\\"'\")\n            )\n\n    # Check that the process.container name is pulling the version tag or :dev\n    if self.nf_config.get(\"process.container\"):\n        container_name = \"{}:{}\".format(\n            self.nf_config.get(\"manifest.name\").replace(\"nf-core\", \"nfcore\").strip(\"'\"),\n            self.nf_config.get(\"manifest.version\", \"\").strip(\"'\"),\n        )\n        if \"dev\" in self.nf_config.get(\"manifest.version\", \"\") or not self.nf_config.get(\"manifest.version\"):\n            container_name = \"{}:dev\".format(\n                self.nf_config.get(\"manifest.name\").replace(\"nf-core\", \"nfcore\").strip(\"'\")\n            )\n        try:\n            assert self.nf_config.get(\"process.container\", \"\").strip(\"'\") == container_name\n        except AssertionError:\n            if self.release_mode:\n                failed.append(\n                    \"Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``\".format(\n                        container_name, self.nf_config.get(\"process.container\", \"\").strip(\"'\")\n                    )\n                )\n            else:\n                warned.append(\n                    \"Config ``process.container`` looks wrong. Should be ``{}`` but is ``{}``\".format(\n                        container_name, self.nf_config.get(\"process.container\", \"\").strip(\"'\")\n                    )\n                )\n        else:\n            passed.append(\"Config ``process.container`` looks correct: ``{}``\".format(container_name))\n\n    # Check that the pipeline version contains ``dev``\n    if not self.release_mode and \"manifest.version\" in self.nf_config:\n        if self.nf_config[\"manifest.version\"].strip(\" '\\\"\").endswith(\"dev\"):\n            passed.append(\n                \"Config ``manifest.version`` ends in ``dev``: ``{}``\".format(self.nf_config[\"manifest.version\"])\n            )\n        else:\n            warned.append(\n                \"Config ``manifest.version`` should end in ``dev``: ``{}``\".format(self.nf_config[\"manifest.version\"])\n            )\n    elif \"manifest.version\" in self.nf_config:\n        if \"dev\" in self.nf_config[\"manifest.version\"]:\n            failed.append(\n                \"Config ``manifest.version`` should not contain ``dev`` for a release: ``{}``\".format(\n                    self.nf_config[\"manifest.version\"]\n                )\n            )\n        else:\n            passed.append(\n                \"Config ``manifest.version`` does not contain ``dev`` for release: ``{}``\".format(\n                    self.nf_config[\"manifest.version\"]\n                )\n            )\n\n    # Check if custom profile params are set correctly\n    if self.nf_config.get(\"params.custom_config_version\", \"\").strip(\"'\") == \"master\":\n        passed.append(\"Config `params.custom_config_version` is set to `master`\")\n    else:\n        failed.append(\"Config `params.custom_config_version` is not set to `master`\")\n\n    custom_config_base = \"https://raw.githubusercontent.com/nf-core/configs/{}\".format(\n        self.nf_config.get(\"params.custom_config_version\", \"\").strip(\"'\")\n    )\n    if self.nf_config.get(\"params.custom_config_base\", \"\").strip(\"'\") == custom_config_base:\n        passed.append(\"Config `params.custom_config_base` is set to `{}`\".format(custom_config_base))\n    else:\n        failed.append(\"Config `params.custom_config_base` is not set to `{}`\".format(custom_config_base))\n\n    # Check that lines for loading custom profiles exist\n    lines = [\n        r\"// Load nf-core custom profiles from different Institutions\",\n        r\"try {\",\n        r'includeConfig \"${params.custom_config_base}/nfcore_custom.config\"',\n        r\"} catch (Exception e) {\",\n        r'System.err.println(\"WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config\")',\n        r\"}\",\n    ]\n    path = os.path.join(self.wf_path, \"nextflow.config\")\n    i = 0\n    with open(path, \"r\") as f:\n        for line in f:\n            if lines[i] in line:\n                i += 1\n                if i == len(lines):\n                    break\n            else:\n                i = 0\n    if i == len(lines):\n        passed.append(\"Lines for loading custom profiles found\")\n    else:\n        lines[2] = f\"\\t{lines[2]}\"\n        lines[4] = f\"\\t{lines[4]}\"\n        failed.append(\n            \"Lines for loading custom profiles not found. File should contain: ```groovy\\n{}\".format(\"\\n\".join(lines))\n        )\n\n    return {\"passed\": passed, \"warned\": warned, \"failed\": failed, \"ignored\": ignored}\n", "path": "nf_core/lint/nextflow_config.py"}]}