8000 fix: guard against empty pipeline name in files_exist lint by abhi-0203 · Pull Request #4466 · nf-core/tools · GitHub
[go: up one dir, main page]

Skip to content
< 10000 link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/al-15207e619db24a57.js" fetchpriority="low" />

fix: guard against empty pipeline name in files_exist lint - #4466

Open
abhi-0203 wants to merge 1 commit into
nf-core:mainfrom
abhi-0203:fix/empty-pipeline-name-indexerror
Open

abhi-0203 wants to merge 1 commit into
nf-core:mainfrom
abhi-0203:fix/empty-pipeline-name-indexerror

Conversation

@abhi-0203
Copy link
Copy Markdown

Summary

When manifest.name is empty in the pipeline config, files_exist lint falls back to using it as short_name directly. The Path templates then use short_name[0].upper() and short_name[1:], which raises IndexError on an empty string.

Fix

Guard against empty short_name and use a placeholder value ("UNNAMED") so that the Path templates don't crash. This prevents the crash and allows the lint to continue running.

Testing

  • Verified the bug: short_name = "" → "".split("/") returns [""], so short_name becomes "", then "".split("/")[0].upper() raises IndexError.
  • Verified the fix prevents the crash.

Fixes #4464

When manifest.name is empty, the lint falls back to using it as
short_name directly. The Path templates then use short_name[0].upper()
and short_name[1:], which raises IndexError on an empty string.

Fix by guarding against empty short_name and using a placeholder.

Fixes nf-core#4464.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexError: string index out of range

1 participant

0