Skip to content

Conversation

@ewels
Copy link
Member

@ewels ewels commented Jan 22, 2026

Repeat of #9684 but from a branch, not a fork.

ewels and others added 29 commits January 17, 2026 22:33
Remove variable redeclarations by renaming closure parameters and local
variables that shadow input parameters or previously declared variables.

Fixed modules:
- bbmap/bbsplit: Renamed 'index' closure parameter to 'idx' in eachWithIndex
- bedtools/groupby: Renamed local 'summary_col' to 'summary_col_opt'
- mafft/align: Renamed stub section variables with '_stub' suffix
- spaceranger/count: Renamed option variables with '_opt' suffix

This addresses variable redeclaration errors flagged by nextflow lint in
strict syntax mode (NXF_SYNTAX_PARSER=v2).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Continue fixing variable redeclaration errors for strict syntax mode:

- krakentools/extractkrakenreads: Use distinct meta parameter names (meta2, meta3)
- mafft/align: Rename local option variables with _opt suffix
- blobtk/plot: Add def keyword to script section variables
- cellranger/count: Add def keyword to script section variables
- diann: Add def keyword to script section variables
- flash: Add def keyword to script section variables
- scds: Add def keyword to script section variables

In strict syntax mode, all variable declarations must use the def keyword
explicitly, and variables cannot be redeclared within the same scope.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Continue fixing variable redeclarations:

- peka, pureclip: Use distinct meta parameter names for multiple tuple inputs
- svtyper/svtyper: Fix duplicate meta2 in inputs, rename vcf shadow variable
- svtyper/svtypersso: Rename vcf and fasta shadow variables with _opt suffix
- cellrangerarc/mkref: Rename reference_config to reference_config_name
- eklipse: Rename ref_gb to ref_gb_path
- ichorcna/createpon: Rename exons to exons_opt, add def to prefix
- igvreports: Rename fasta to fasta_opt

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Complete fixing all variable redeclaration errors for strict syntax mode:

- pureclip: Use distinct meta parameter name (meta3) for third input
- jvarkit/sam2tsv, jvarkit/vcf2table: Rename regions_file to regions_opt
- hmmer/hmmfetch: Rename index to index_opt
- chewbbaca/createschema: Rename prodigal_tf and cds to *_opt
- cnvnator/cnvnator: Add def to prefix in script section
- crumble: Rename bedout to bedout_opt in both script and stub
- gmmdemux: Rename skip and type_report to *_opt
- happy/sompy: Rename bams to bams_opt
- salsa2: Rename gfa and dup to *_opt
- sam2lca/analyze: Rename database to database_path
- segemehl/align: Rename reads to reads_opt, add def to prefix
- svanalyzer/svbenchmark: Rename bed to bed_opt

All 53 variable redeclaration errors have been resolved.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Addresses review comments from @SPPearce on PR #9684:

1. Remove 'def' from prefix variables used in output blocks:
   - cnvnator/cnvnator: Remove def from prefix (script & stub)
   - diann: Remove def from prefix (script & stub)
   - flash: Remove def from prefix (script & stub)
   - ichorcna/createpon: Remove def from prefix (script only)
   - segemehl/align: Remove def from prefix (script only)

2. Remove unnecessary variable declarations:
   - mafft/align: Remove unused stub variables (args_stub, add_stub,
     addfragments_stub, addfull_stub, addprofile_stub, addlong_stub)
   - mafft/align: Remove def from prefix (script) and prefix_stub

3. Improve code formatting:
   - spaceranger/count: Add backslash continuation between image option
     variables for better readability

All changes verified with:
- nextflow lint (all modules pass)
- NXF_SYNTAX_PARSER=v2 nextflow inspect (all modules pass)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When process inputs use meta2/meta3 to avoid variable redeclaration,
the corresponding meta.yml files must document these renamed variables.

Updated:
- krakentools/extractkrakenreads: meta → meta2, meta3
- peka: meta → meta2
- pureclip: meta → meta2, meta3
- svtyper/svtyper: meta2 → meta3 (for fai input)

All modules verified with:
- nextflow inspect (standard parser)
- NXF_SYNTAX_PARSER=v2 nextflow inspect (strict parser)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Resolve merge conflicts in:
- bbmap/bbsplit: Use _idx for unused loop variable
- bedtools/groupby: Use input summary_col with proper syntax
- mafft/align: Keep _opt suffix variables to avoid redeclarations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove `def` from prefix variable to make it accessible to the
tag directive which is evaluated before the script block.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- hmmer/hmmfetch: Update test data URL from master to 0.9 tag
  (master branch no longer has the HMM file)
- peka: Bump version from 1.0.0 to 1.0.2
  (1.0.0 requires numpy 1.17.4 which is no longer available)
- crumble: Update test assertions to not use bam() plugin for CRAM
  (htsjdk doesn't support CRAM 3.1 format)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update barrnap test data URL from master to 0.9 tag.
The master branch no longer has the HMM database files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- peka: Update versions.yml hash for 1.0.2
- svtyper/svtypersso: Update VCF output hash

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove `def` from variables that need to be accessible to templates.
Variables defined with `def` are local to the script block and cannot
be accessed by template files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update to use existing test data from modules branch.
The scdownstream branch does not exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update hmmer/hmmrank snapshot with new MD5 hash after barrnap URL fix
- Update svtyper/svtypersso snapshot with correct bam test MD5 hash
- Fix scds test to use raw_matrix.sce.rds which has required "counts" assay

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The SCDS test data at scdownstream/samples/SAMN14430801_... doesn't exist.
This is a pre-existing issue, not caused by this PR. The module needs
proper test data added to nf-core/test-datasets before it can be fixed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use existing test data from scdownstream branch (pbmc/SRR28679757_raw_matrix.sce.rds)
- Remove def from prefix in both script and stub blocks for template access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update svtyper/svtypersso snapshot hashes for bam and bam_vcf_fasta tests
- Keep scds prefix fix (remove def) for template access, revert test URL
  changes as no available test data has required "counts" assay

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use commit-pinned URL for scds test data with counts assay
- Update svtyper/svtypersso snapshot hashes for bam and bam_vcf_fasta tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ewels ewels closed this Jan 23, 2026
@ewels ewels deleted the fix/variable-redeclarations branch January 23, 2026 13:34
@SPPearce SPPearce restored the fix/variable-redeclarations branch January 25, 2026 09:31
@SPPearce SPPearce reopened this Jan 25, 2026
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.

3 participants