Linting Errors

This page contains detailed descriptions of the tests done by the nf-core/tools package. Linting errors should show URLs next to any failures that link to the relevant heading below.

Error #1 - File not found

nf-core pipelines should adhere to a common file structure for consistency. The lint test looks for the following required files:

The following files are suggested but not a hard requirement. If they are missing they trigger a warning:

Error #2 - Docker / Singularity file check failed

Pipelines should have a files called Dockerfile and Singularity in their root directory. These are used for automated docker and singularity image builds. This test checks that the files exist and contain at least the string FROM (Dockerfile) / From: (Singularity).

Error #3 - Licence check failed

nf-core pipelines must ship with an open source MIT licence.

This test fails if the following conditions are not met:

Error #4 - Nextflow config check failed

nf-core pipelines are required to be configured with a minimal set of variable names. This test fails or throws warnings if required variables are not set.

Note: These config variables must be set in nextflow.config or another config file imported from there. Any variables set in nextflow script files (eg. main.nf) are not checked and will be assumed to be missing.

The following variables fail the test if missing:

The following variables throw warnings if missing:

The following variables are depreciated and fail the test if they are still present:

Error #5 - Continuous Integration configuration

nf-core pipelines must have CI testing with Travis or Circle CI.

This test fails if the following happens:

Error #6 - Repository README.md tests

The README.md files for a project are very important and must meet some requirements:

Error #7 - Pipeline and container version numbers

This test only runs when --release is set or $TRAVIS_BRANCH is equal to master

These tests look at params.container, process.container and $TRAVIS_TAG, only if they are set.

Error #8 - Conda environment tests

These tests only run when your pipeline has a root file called environment.yml

Each dependency is checked using the Anaconda API service. Dependency sublists are ignored with the exception of - pip: these packages are also checked for pinned version numbers and checked using the PyPI JSON API.

Note that conda dependencies with pinned channels (eg. conda-forge::openjdk) are fine and should be handled by the linting properly.

Each dependency can have the following lint failures and warnings:

Error #9 - Dockerfile for use with Conda environments

This test only runs if there is both environment.yml and Dockerfile present in the workflow.

If a workflow has a conda environment.yml file (see above), the Dockerfile should use this to create the container. Such Dockerfiles can usually be very short, eg:

FROM nfcore/base
LABEL authors="your@email.com" \
      description="Container image containing all requirements for nf-core/EXAMPLE pipeline"

COPY environment.yml /
RUN conda env update -n root -f /environment.yml && conda clean -a

To enforce this minimal Dockerfile and check for common copy+paste errors, we require that the above template is used. Failures are generated if the FROM, COPY and RUN statements above are not present. These lines must be an exact copy of the above example.

Additional lines and different metadata can be added without causing the test to fail.

Error #10 - Singularity for use with Conda environments

This test only runs if there is both environment.yml and Singularity file present in the workflow.

If a workflow has a conda environment.yml file (see above), the Singularity build script should use this to create the container. Such Singularity files can usually be very short, eg:

From:nfcore/base
Bootstrap:docker

%labels
    MAINTAINER Your Name <your@email.com>
    DESCRIPTION Container image containing all requirements for the nf-core/EXAMPLE pipeline
    VERSION [pipeline version]

%files
    environment.yml /

%post
    /opt/conda/bin/conda env update -n root -f /environment.yml
    /opt/conda/bin/conda clean -a

To enforce this minimal Singularity and check for common copy+paste errors, we require that the above template is used. Specifically, presence of these lines is checked for:

Additional lines and different metadata can be added without causing the test to fail.

Error #11 - Template TODO statement found

The nf-core workflow template contains a number of comment lines with the following format:

// TODO nf-core: Make some kind of change to the workflow here

This lint test runs through all files in the pipeline and searches for these lines.