See the Lint Tests docs for information about specific linting functions.

Linting policy for nf-core pipeline projects.

Tests Nextflow-based pipelines to check that they adhere to the nf-core community guidelines.

nf_core.lint.run_linting(pipeline_dir, release_mode=False, fix=(), key=(), show_passed=False, fail_ignored=False, fail_warned=False, sort_by='test', md_fn=None, json_fn=None, hide_progress=False)

Runs all nf-core linting checks on a given Nextflow pipeline project in either release mode or normal mode (default). Returns an object of type PipelineLint after finished.

  • Parameters:
    • pipeline_dir (str) – The path to the Nextflow pipeline root directory
    • release_mode (bool) – Set this to True, if the linting should be run in the release mode. See PipelineLint for more information.
  • Returns: An object of type PipelineLint that contains all the linting results. An object of type ComponentLint that contains all the linting results for the modules. An object of type ComponentLint that contains all the linting results for the subworkflows.

classnf_core.lint.PipelineLint(wf_path, release_mode=False, fix=(), key=None, fail_ignored=False, fail_warned=False, hide_progress=False)

Bases: Pipeline

Object to hold linting information and results.

Inherits nf_core.utils.Pipeline class.

Use the PipelineLint._lint_pipeline() function to run lint tests.

  • Parameters: path (str) – The path to the nf-core pipeline directory.


A list of tuples of the form: (<test-name>, <reason>)

  • Type: list


A list of tuples of the form: (<test-name>, <reason>)

  • Type: list


The parsed nf-core linting config for this pipeline

  • Type: dict


A list of tuples of the form: (<test-name>, <reason>)

  • Type: list


True, if you the to linting was run in release mode, False else.

  • Type: bool


A list of tuples of the form: (<warned no>, <reason>)

  • Type: list


Create a markdown file suitable for posting in a GitHub comment.

  • Returns: Formatting markdown content
  • Return type: markdown (str)


Main linting function.

Takes the pipeline directory as the primary input and iterates through the different linting checks in order. Collects any warnings or errors into object attributes: passed, ignored, warned and failed.


Print linting results to the command line.

Uses the rich library to print a set of formatted tables to the command line summarising the linting results.


Function to dump lint results to a JSON file for downstream use

  • Parameters: json_fn (str) – File path to write JSON to.

_wrap_quotes(files: List[str] | List[Path] | Path)

Helper function to take a list of filenames and format with markdown.

  • Parameters: files (list) –

    List of filenames, eg:

    ['foo', 'bar', 'baz']
  • Returns: Formatted string of paths separated by word or, eg:

    `foo` or bar` or `baz`
  • Return type: markdown (str)