Skip to content

Improve lint errors for common gotchas - #7742

Merged
bentsherman merged 5 commits into
masterfrom
fix-nextflow-gotchas
Oct 3, 2026
Merged

bentsherman merged 5 commits into
masterfrom
fix-nextflow-gotchas

Conversation

@bentsherman

Copy link
Copy Markdown
Member

This PR fixes two error messages that came up while going through nextflow-gotchas.

  • Process or workflow used as a variable. In a typed script, using a process, workflow, or agent name as a value, for example ch.mix(FOO) or FOO.out, now gives the error Process `FOO` cannot be used as a variable. This check replaces the separate .out error in TypeCheckingVisitor.
  • Unexpected end of file. When the script or config parser hits EOF, the error now reads Unexpected end of file -- check for an unclosed brace, bracket, parenthesis, or string. Before, the message was a generic syntax error.

Each fix is its own commit, with tests in ScriptResolveTest, ScriptAstBuilderTest, and ConfigAstBuilderTest.

A bare process, workflow, or agent name was given a dynamic type, so
mistakes like `ch.mix(PROC)` passed the type checker. Typed workflows
don't support pipes or `.out`, so referencing one as a variable is
always an error. This also covers `.out`, so the separate check in the
type checker is removed.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
A syntax error at the end of a script or config file was reported as
`Unexpected input: '<EOF>'`, which doesn't explain the mistake. It is
almost always caused by an unclosed brace, bracket, parenthesis, or
string, so suggest those instead.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman
bentsherman requested a review from a team as a code owner October 2, 2026 13:57
@netlify

netlify Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nextflow-docs ready!

Name Link
🔨 Latest commit e1b3614
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs/deploys/6ac101c2ae1eef0008fe60a1
😎 Deploy Preview https://deploy-preview-7742--nextflow-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman

Copy link
Copy Markdown
Member Author

I looked into a related issue as part of this, which is an old cryptic error about a 64 KB size limit for scripts. We added a docs note without ever digging into it

It turns out there were two different limits:

  • String literals cannot exceed 64 KB. This happened at least once with a long workflow body in the v1 parser. It could also happen with a long process body but is extremely unlikely

  • A method's bytecode cannot exceed 64 KB. This can happen with a large workflow body, although it is also unlikely and AFAIK has never happened in practice

So I don't think the docs notes are worth keeping since they are extreme cases. The v2 parser is the default now and it does not have the failure mode from v1 that occurred in the wild

@bentsherman
bentsherman merged commit 6905d44 into master Oct 3, 2026
26 checks passed
@bentsherman
bentsherman deleted the fix-nextflow-gotchas branch October 3, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants