Skip to content

Fix lint: preserve underscores for subworkflow includes via full path#4074

Merged
pinin4fjords merged 7 commits intodevfrom
fix/subworkflow-include-underscore-conversion
Mar 3, 2026
Merged

Fix lint: preserve underscores for subworkflow includes via full path#4074
pinin4fjords merged 7 commits intodevfrom
fix/subworkflow-include-underscore-conversion

Conversation

@pinin4fjords
Copy link
Member

Summary

  • Fix get_components_to_install() to check whether a full-path include (../../../...) points to a subworkflow or module before deriving the component name
  • Subworkflow includes (containing subworkflows/ in the path) now preserve underscores and are correctly added to the subworkflows dict
  • Module includes continue to convert underscores to slashes as before

Problem

When a subworkflow includes another subworkflow using the full path:

include { VCF_GATHER_BCFTOOLS } from '../../../subworkflows/nf-core/vcf_gather_bcftools'

The linter converted the name to vcf/gather/bcftools (splitting on underscores), causing a meta_include lint failure even when meta.yml correctly lists vcf_gather_bcftools in components.

This is because the ../../../ path prefix check assumed all full-path includes were modules. Relative subworkflow includes (../vcf_gather_bcftools) worked fine since they hit a different code path.

Context

Encountered in nf-core/modules#10283

Fixes #4073

🤖 Generated with Claude Code

pinin4fjords and others added 2 commits March 2, 2026 13:21
…es via full path

When a subworkflow includes another subworkflow using the full path
(e.g., `../../../subworkflows/nf-core/vcf_gather_bcftools`), the linter
incorrectly converted underscores to slashes, producing
`vcf/gather/bcftools` instead of `vcf_gather_bcftools`.

This happened because the `../../../` prefix check assumed all full-path
includes were modules (where underscore-to-slash conversion is correct).
Subworkflow includes via full paths also start with `../../../` but
should preserve underscores since subworkflow directory names use them.

The fix checks whether the include path contains `subworkflows/` before
deciding how to derive the component name.

Fixes #4073

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.42%. Comparing base (f9aa3af) to head (4971ccb).

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
@pinin4fjords pinin4fjords requested a review from mashehu March 3, 2026 09:27
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a test so we make sure this doesn't happen again 🙂
tests/components/test_components_utils.py is the relevant place for it

pinin4fjords and others added 4 commits March 3, 2026 10:29
Cover full-path subworkflow includes (underscore preservation),
full-path module includes (underscore-to-slash conversion), relative
subworkflow includes, and mixed include scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…b.com:nf-core/tools into fix/subworkflow-include-underscore-conversion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pinin4fjords pinin4fjords requested a review from mashehu March 3, 2026 10:40
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking great now. Thanks!

@pinin4fjords pinin4fjords merged commit c2e6e22 into dev Mar 3, 2026
112 checks passed
@pinin4fjords pinin4fjords deleted the fix/subworkflow-include-underscore-conversion branch March 3, 2026 10:52
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.

Subworkflow lint incorrectly converts underscores to slashes for subworkflow-to-subworkflow includes via full path

3 participants