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

Container warns if permission is denied #2270

Merged
merged 8 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"