Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,35 @@ is sorted alphabetically.

The following checks are performed:

- `environment_yml_exists`: The `environment.yml` file must exist, unless the
module has a Dockerfile. If neither `environment.yml` nor a Dockerfile is
present, the test fails.
- `environment_yml_dockerfile_conflict`: A module must not have both an
`environment.yml` and a Dockerfile; Remove the Dockerfile if present.
- `environment_yml_valid`: The `environment.yml` must be valid according to
the JSON schema defined at <https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json>.
- `environment_yml_sorted`: The dependencies listed in `environment.yml`
must be sorted alphabetically. If they are not, they will be sorted
automatically.
- `bioconda_version`: The version specified for each bioconda package must
be a valid, known version available in the bioconda channel.
- `bioconda_latest`: Each bioconda package should be pinned to the latest
available version. A warning is raised (or the version updated if
`fix_version` is set) when a newer version exists.
## environment\_yml\_exists

The `environment.yml` file must exist, unless the
module has a Dockerfile. If neither `environment.yml` nor a Dockerfile is
present, the test fails.

## environment\_yml\_dockerfile\_conflict

A module must not have both an
`environment.yml` and a Dockerfile; Remove the Dockerfile if present.

## environment\_yml\_valid

The `environment.yml` must be valid according to
the JSON schema defined at <https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json>.

## environment\_yml\_sorted

The dependencies listed in `environment.yml`
must be sorted alphabetically. If they are not, they will be sorted
automatically.

## bioconda\_version

The version specified for each bioconda package must
be a valid, known version available in the bioconda channel.

## bioconda\_latest

Each bioconda package should be pinned to the latest
available version. A warning is raised (or the version updated if
`fix_version` is set) when a newer version exists.
101 changes: 68 additions & 33 deletions sites/docs/src/content/api_reference/dev/module_lint_tests/main_nf.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,71 @@ in which case failures will be reported as warnings.

The following checks are performed:

- `main_nf_module_granularity`: The module must represent a single command
as `<tool>` or single subcommand with distinct functionality as
`<tool/subtool>`.
- `main_nf_exists`: The `main.nf` file must exist.
- `deprecated_dsl2`: The file must not contain deprecated DSL2 identifiers
(`initOptions`, `saveFiles`, `getSoftwareName`, `getProcessName`,
`publishDir`).
- `main_nf_script_outputs`: The process must have an `output:` block.
- `main_nf_container`: When both a `singularity` and a `docker` container
are specified, their tags must reference the same software version. A warning
is issued if they do not match. Modules using the newer docker-only format
(no singularity container) skip this check.
- `singularity_tag`: A Singularity container must be resolvable via
`nextflow inspect -profile singularity`. The check fails if none can be
resolved or if it falls back to a docker container that has an automatic
singularity equivalent, i.e., `quay.io/biocontainers/` or
`community.wave.seqera.io/`.
It is skipped for modules listed under `singularity` in `.github/skip_nf_test.json`.
- `oras_singularity_tag`: The resolved Singularity container must not be
served over the `oras://` scheme; it should be a plain `https://` URL.
The check fails if an `oras://` container is used.
- `main_nf_script_shell`: Exactly one of `script:`, `shell:`, or `exec:`
blocks must be present.
- `main_nf_shell_template`: If a `shell:` block is used, it must call
a `template`.
- `main_nf_meta_output`: If `meta` is present in the module inputs, it
must also appear in at least one output channel.
- `main_nf_version_topic`: The module should emit software versions using
a `topic: versions` output. A warning is issued if no such topic is found.
- `main_nf_version_emit`: The number of `topic: versions` outputs must
equal the number of `emit:` outputs whose name starts with `versions`.
A warning is issued if a legacy YAML-based `versions` emit is used instead
of a topic output.
## main\_nf\_module\_granularity

The module must represent a single command
as `<tool>` or single subcommand with distinct functionality as
`<tool/subtool>`.

## main\_nf\_exists

The `main.nf` file must exist.

## deprecated\_dsl2

The file must not contain deprecated DSL2 identifiers
(`initOptions`, `saveFiles`, `getSoftwareName`, `getProcessName`,
`publishDir`).

## main\_nf\_script\_outputs

The process must have an `output:` block.

## main\_nf\_container

When both a `singularity` and a `docker` container
are specified, their tags must reference the same software version. A warning
is issued if they do not match. Modules using the newer docker-only format
(no singularity container) skip this check.

## singularity\_tag

A Singularity container must be resolvable via
`nextflow inspect -profile singularity`. The check fails if none can be
resolved or if it falls back to a docker container that has an automatic
singularity equivalent, i.e., `quay.io/biocontainers/` or
`community.wave.seqera.io/`.
It is skipped for modules listed under `singularity` in `.github/skip_nf_test.json`.

## oras\_singularity\_tag

The resolved Singularity container must not be
served over the `oras://` scheme; it should be a plain `https://` URL.
The check fails if an `oras://` container is used.

## main\_nf\_script\_shell

Exactly one of `script:`, `shell:`, or `exec:`
blocks must be present.

## main\_nf\_shell\_template

If a `shell:` block is used, it must call
a `template`.

## main\_nf\_meta\_output

If `meta` is present in the module inputs, it
must also appear in at least one output channel.

## main\_nf\_version\_topic

The module should emit software versions using
a `topic: versions` output. A warning is issued if no such topic is found.

## main\_nf\_version\_emit

The number of `topic: versions` outputs must
equal the number of `emit:` outputs whose name starts with `versions`.
A warning is issued if a legacy YAML-based `versions` emit is used instead
of a topic output.
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,66 @@ to the nf-core JSON schema, and that its contents are consistent with

The following checks are performed:

- `meta_yml_exists`: The `meta.yml` file must exist.
- `meta_yml_valid`: The `meta.yml` must be valid according to the JSON
schema defined in `modules/meta-schema.json` in the nf-core/modules
repository.
- `meta_name`: The `name` field in `meta.yml` must match (case-insensitive)
the process name declared in `main.nf`.
- `meta_input`: If `main.nf` declares inputs, they must be listed under
the `input:` key in `meta.yml`.
- `correct_meta_inputs`: The inputs listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.
- `meta_output`: If `main.nf` declares outputs, they must be listed under
the `output:` key in `meta.yml`.
- `correct_meta_outputs`: The outputs listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.
- `has_meta_topics`: If `main.nf` declares topics, `meta.yml` must
also contain a non-empty `topics:` block. Run
`nf-core modules lint --fix` to auto-correct.
- `correct_meta_topics`: The topics listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.
- `has_meta_containers`: If `main.nf` declares containers, `meta.yml`
must also contain a non-empty `containers:` block. Run
`nf-core modules lint --fix` to auto-correct.
- `correct_meta_containers`: The containers listed in `meta.yml` must
exactly match those parsed from `main.nf`. Run
`nf-core modules lint --fix` to auto-correct.
## meta\_yml\_exists

The `meta.yml` file must exist.

## meta\_yml\_valid

The `meta.yml` must be valid according to the JSON
schema defined in `modules/meta-schema.json` in the nf-core/modules
repository.

## meta\_name

The `name` field in `meta.yml` must match (case-insensitive)
the process name declared in `main.nf`.

## meta\_input

If `main.nf` declares inputs, they must be listed under
the `input:` key in `meta.yml`.

## correct\_meta\_inputs

The inputs listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.

## meta\_output

If `main.nf` declares outputs, they must be listed under
the `output:` key in `meta.yml`.

## correct\_meta\_outputs

The outputs listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.

## has\_meta\_topics

If `main.nf` declares topics, `meta.yml` must
also contain a non-empty `topics:` block. Run
`nf-core modules lint --fix` to auto-correct.

## correct\_meta\_topics

The topics listed in `meta.yml` must exactly
match those parsed from `main.nf`. Run `nf-core modules lint --fix`
to auto-correct.

## has\_meta\_containers

If `main.nf` declares containers, `meta.yml`
must also contain a non-empty `containers:` block. Run
`nf-core modules lint --fix` to auto-correct.

## correct\_meta\_containers

The containers listed in `meta.yml` must
exactly match those parsed from `main.nf`. Run
`nf-core modules lint --fix` to auto-correct.

If the module has inputs or outputs, they are expected to be formatted as:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ Only runs when linting a pipeline, not the modules repository

The following checks are performed:

- `check_local_copy`: Each module file must be identical to the corresponding
file in the remote repository at the pinned commit SHA.
## check\_local\_copy

Each module file must be identical to the corresponding
file in the remote repository at the pinned commit SHA.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ Check that the modules are up to the latest nf-core standard

The following checks are performed:

- `module_deprecations`: Deprecated files (e.g. `functions.nf`) must not
be present in the module directory.
## module\_deprecations

Deprecated files (e.g. `functions.nf`) must not
be present in the module directory.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,43 @@ validates snapshot content, and verifies that nf-test tags follow guidelines.

The following checks are performed:

- `test_dir_exists`: The nf-test directory `tests/` must exist.
- `test_main_nf_exists`: The file `tests/main.nf.test` must exist.
- `test_snapshot_exists`: If `snapshot()` is called in `main.nf.test`,
the snapshot file `tests/main.nf.test.snap` must exist and be valid JSON.
- `test_snap_md5sum`: The snapshot must not contain md5sums for empty files
(`d41d8cd98f00b204e9800998ecf8427e`) or empty compressed files
(`7029066c27ac6f5ef18d660d5741979a`), unless the test name contains `stub`.
- `test_snap_versions`: The snapshot must contain a `versions` key.
- `test_main_tags`: The `main.nf.test` file must declare the required tags:
`modules`, `modules_<org>`, the full component name, and (for `tool/subtool`
modules) the tool name alone. Tags for any chained components included via
`include` statements must also be present.
- `test_old_test_dir`: The legacy pytest directory
`tests/modules/<component_name>/` must not exist.
## test\_dir\_exists

The nf-test directory `tests/` must exist.

## test\_main\_nf\_exists

The file `tests/main.nf.test` must exist.

## test\_snapshot\_exists

If `snapshot()` is called in `main.nf.test`,
the snapshot file `tests/main.nf.test.snap` must exist and be valid JSON.

## test\_snap\_md5sum

The snapshot must not contain md5sums for empty files
(`d41d8cd98f00b204e9800998ecf8427e`) or empty compressed files
(`7029066c27ac6f5ef18d660d5741979a`), unless the test name contains `stub`.

## test\_snap\_versions

The snapshot must contain a `versions` key.

## test\_main\_tags

The `main.nf.test` file must declare the required tags:
`modules`, `modules_<org>`, the full component name, and (for `tool/subtool`
modules) the tool name alone. Tags for any chained components included via
`include` statements must also be present.

## test\_old\_test\_dir

The legacy pytest directory
`tests/modules/<component_name>/` must not exist.

## test\_stub\_gzip\_syntax

Stub blocks with gzip output files must use the proper syntax. Stub files
ending in `.gz` must use `echo "" | gzip > file.gz`. Simply touching or
creating empty `.gz` files will break nf-test’s gzip parser.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ They typically have the following format:
This lint test runs through all files in the module and searches for these lines.
If any are found they will throw a warning.

- `module_todo`: A warning is issued for each TODO comment found in the
module files.
## module\_todo

A warning is issued for each TODO comment found in the
module files.

:::note
Note that many GUI code editors have plugins to list all instances of _TODO_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ newer version of the module available.

The following checks are performed:

- `git_sha`: The module must have a `git_sha` entry in `modules.json`.
- `module_version`: The module version must match the latest commit in the
remote repository. A warning is issued if a newer version is available.
## git\_sha

The module must have a `git_sha` entry in `modules.json`.

## module\_version

The module version must match the latest commit in the
remote repository. A warning is issued if a newer version is available.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ The test checks for the following:

The following checks are performed:

- `main_nf_exists`: The `main.nf` file must exist.
- `main_nf_script_outputs`: The workflow must have an `emit:` block.
- `main_nf_version_emitted`: The subworkflow should emit a software version
channel. A warning is issued if no `versions` output is found (can be
ignored if the subworkflow uses topic channels).
## main\_nf\_exists

The `main.nf` file must exist.

## main\_nf\_script\_outputs

The workflow must have an `emit:` block.

## main\_nf\_version\_emitted

The subworkflow should emit a software version
channel. A warning is issued if no `versions` output is found (can be
ignored if the subworkflow uses topic channels).
Loading
Loading