Linter using the Nextflow Language Server

Hi folks,

The language server and the VSCode plugin are great! I’ve been pruning our team pipelines of warnings and errors. Good stuff.

A linter built on top of the language server would be very helpful. Then it would be possible to have a pre-commit hook and a GitHub action that run the linter for us. I was playing around with the language server this morning, trying to build a Python command-line utility to be used as a linter, but I was wondering if someone else has already built this?

Cheers

Hi Martin, we are planning to incorporate the new error checking into Nextflow itself, hopefully in an upcoming edge release in the next few months. I’m thinking we’ll add a nextflow check command that just parses the code, prints any errors/warnings, and exits without running the pipeline.

Hey Ben,

That’s perfect, I’m looking forward to that. I’ll probably tinker with my LSP linter thingy anyway - just for fun.

Cheers

1 Like

Well… after a weekend of tinkering with Groovy and the NF LSP, I wrote this small tool: GitHub - mberacochea/nf-linter: A linter for Nextflow built on top of the Nextflow Language Server.

I am not a Groovy person, so it’s probably full of anti-patterns and code smells. But it seems to work :slight_smile:

1 Like

Very cool! And surprisingly simple

1 Like