Skip to content

Commit

Permalink
Merge pull request #2270 from adamrtalbot/container_url_error
Browse files Browse the repository at this point in the history
Container warns if permission is denied
  • Loading branch information
ewels authored May 3, 2023
2 parents 14a14d8 + f067e87 commit 1fae5c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Linting

- Warn if container access is denied ([#2270](https://github.com/nf-core/tools/pull/2270))

### Modules

### Subworkflows
Expand Down
16 changes: 9 additions & 7 deletions nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,14 @@ def check_process_section(self, lines, fix_version, progress_bar):
log.debug(f"Unable to connect to url '{urlunparse(url)}' due to error: {e}")
self.failed.append(("container_links", "Unable to connect to container URL", self.main_nf))
continue
if response.status_code != 200:
self.failed.append(("container_links", "Unable to connect to container URL", self.main_nf))
if not response.ok:
self.failed.append(
(
"container_links",
f"Unable to connect to {response.url}, status code: {response.status_code}",
self.main_nf,
)
)

# Check that all bioconda packages have build numbers
# Also check for newer versions
Expand Down Expand Up @@ -581,9 +587,5 @@ def _container_type(line):
if url_match:
return "singularity"
return None
if (
line.startswith("biocontainers/")
or line.startswith("quay.io/")
or (line.count("/") == 1 and line.count(":") == 1)
):
if line.count("/") >= 1 and line.count(":") == 1:
return "docker"

0 comments on commit 1fae5c2

Please sign in to comment.