Linting policy for nf-core pipeline projects.

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


Object to hold linting information and results. All objects attributes are set, after the PipelineLint.lint_pipeline() function was called.

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


The parsed conda configuration file content (environment.yml).

  • Type: dict


The conda package(s) information, based on the API requests to Anaconda cloud.

  • Type: dict


The Nextflow pipeline configuration file content.

  • Type: dict


A list of lines (str) from the parsed Dockerfile.

  • Type: list


A list of tuples of the form: (, )

  • Type: list


A list of files found during the linting process.

  • Type: list


The minimum required Nextflow version to run the pipeline.

  • Type: str


A list of tuples of the form: (, )

  • Type: list


Path to the pipeline directory.

  • Type: str


The pipeline name, without the nf-core tag, for example hlatyping.

  • Type: str


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

  • Type: bool


A list of tuples of the form: (, )

  • Type: list

Attribute specifications

Some of the more complex attributes of a PipelineLint object.

  • conda_config:
    # Example
        'name': 'nf-core-hlatyping',
        'channels': ['bioconda', 'conda-forge'],
        'dependencies': ['optitype=1.3.2', 'yara=0.9.6']
  • conda_package_info:
    # See as an example.
        <package>: <API JSON repsonse object>
  • config: Produced by calling Nextflow with nextflow config -flat <workflow dir>. Here is an example from : the nf-core/hlatyping pipeline:
    process.container = 'nfcore/hlatyping:1.1.1' = false
    params.outdir = './results'
    params.bam = false
    params.single_end = false
    params.seqtype = 'dna'
    params.solver = 'glpk'
    params.igenomes_base = './iGenomes'
    params.clusterOptions = false


Checks the GitHub Actions awsfulltest is valid.

Makes sure it is triggered only on release and workflow_dispatch.


Checks the GitHub Actions awstest is valid.

Makes sure it is triggered only on push to master.


Checks that the GitHub Actions branch protection workflow is valid.

Makes sure PRs can only come from nf-core dev or ‘patch’ of a fork.


Checks that the GitHub Actions CI workflow is valid

Makes sure tests run with the required nextflow version.


Checks that the GitHub Actions lint workflow is valid

Makes sure nf-core lint and markdownlint runs.


Query conda package information.

Sends a HTTP GET request to the Anaconda remote API.

  • Parameters: dep (str) – A conda package name.
  • Raises: A ValueError**,** if the package name can not be resolved.


Checks the Docker build file.

Checks that: : * a name is given and is consistent with the pipeline name

  • dependency versions are pinned
  • dependency versions are the latest available


Checks that the conda environment file is valid.

Checks that: : * a name is given and is consistent with the pipeline name

  • check that dependency versions are pinned
  • dependency versions are the latest available


Look for the string ‘cookiecutter’ in all pipeline files. Finding it probably means that there has been a copy+paste error from the template.


Checks that Dockerfile contains the string FROM.


Checks a given pipeline directory for required files.

Iterates through the pipeline’s directory content and checkmarks files for presence. Files that must be present:

['LICENSE', '', 'LICENCE', ''], # NB: British / American spelling

Files that should be present:


Files that must not be present:


Files that should not be present:

  • Raises: An AssertionError if neither nextflow.config or found.


Checks licence file is MIT.

Currently the checkpoints are: : * licence file must be long enough (4 or more lines)

  • licence contains the string without restriction
  • licence doesn’t have any placeholder variables


Checks a given pipeline for required config variables.

At least one string in each list must be present for fail and warn. Any config in config_fail_ifdefined results in a failure.

Uses nextflow config -flat to parse pipeline nextflow.config and print all config variables. NB: Does NOT parse contents of / nextflow script


Query PyPi package information.

Sends a HTTP GET request to the PyPi remote API.

  • Parameters: dep (str) – A PyPi package name.
  • Raises: A ValueError**,** if the package name can not be resolved or the connection timed out.


Check whether pipeline name adheres to lower case/no hyphen naming convention


Go through all template files looking for the string ‘TODO nf-core:’


Checks the repository README file for errors.

Currently just checks the badges at the top of the README.


Lint the pipeline schema


Check that the schema describes all flat params in the pipeline


Checks container tags versions.

Runs on process.container (if set) and $GITHUB_REF (if a GitHub Actions release).

Checks that: : * the container has a tag

  • the version numbers are numeric
  • the version numbers are the same as one-another


Function to create a markdown file suitable for posting in a GitHub comment


If we are running in a GitHub PR, try to post results as a comment


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 and returns summary at completion. Raises an exception if there is a critical error that makes the rest of the tests pointless (eg. no pipeline script). Results from this function are printed by the main script.

  • Parameters: release_mode (boolean) – Activates the release mode, which checks for consistent version tags of containers. Default is False.
  • Returns: Summary of test result messages structured as follows:
        'pass': [
            ( test-id (int), message (string) ),
            ( test-id (int), message (string) )
        'warn': [(id, msg)],
        'fail': [(id, msg)],
  • Return type: dict
  • Raises: If a critical problem is found**,** an AssertionError is raised.


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

nf_core.lint.run_linting(pipeline_dir, release_mode=False, show_passed=False, md_fn=None, json_fn=None)

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.