Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template: Add tests to ensure all files are part of a template customisation group and all groups are tested #3099

Merged
merged 14 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
2 changes: 1 addition & 1 deletion .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Create Matrix
id: create_matrix
run: |
echo "matrix=$(yq 'keys | filter(. != "github") | filter(. != "is_nfcore") | filter(. != "test_config") | tojson(0)' nf_core/pipelines/create/templatefeatures.yml)" >> $GITHUB_OUTPUT
echo "matrix=$(yq 'keys | filter(. != "github") | filter(. != "is_nfcore") | filter(. != "test_config") | tojson(0)' nf_core/pipelines/create/template_features.yml)" >> $GITHUB_OUTPUT

RunTestWorkflow:
runs-on: ${{ matrix.runner }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- add option to exclude documentation from pipeline template ([#3130](https://github.com/nf-core/tools/pull/3130))
- add option to exclude test configs from pipeline template ([#3133](https://github.com/nf-core/tools/pull/3133))
- add option to exclude tower.yml from pipeline template ([#3134](https://github.com/nf-core/tools/pull/3134))
- Add tests to ensure all files are part of a template customisation group and all groups are tested ([#3099](https://github.com/nf-core/tools/pull/3099))

### Linting

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ include nf_core/assets/logo/nf-core-repo-logo-base-darkbg.png
include nf_core/assets/logo/placeholder_logo.svg
include nf_core/assets/logo/MavenPro-Bold.ttf
include nf_core/pipelines/create/create.tcss
include nf_core/pipelines/create/templatefeatures.yml
include nf_core/pipelines/create/template_features.yml
6 changes: 6 additions & 0 deletions nf_core/pipeline-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
</picture>
</h1>

{%- else %}

<h1>
{{ name }}
</h1>
ewels marked this conversation as resolved.
Show resolved Hide resolved

{% endif -%}
{% if github_badges -%}
[![GitHub Actions CI Status](https://github.com/{{ name }}/actions/workflows/ci.yml/badge.svg)](https://github.com/{{ name }}/actions/workflows/ci.yml)
Expand Down
9 changes: 5 additions & 4 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ params {

// Boilerplate options
outdir = null
publish_dir_mode = 'copy'
{% if modules %}publish_dir_mode = 'copy'{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nicer to split these across lines to keep formatting / readability - should be able to use the Jinja - syntax to remove that whitespace on template render.

Needn't be a blocker for merging this though.

{%- if email %}
email = null
email_on_fail = null
plaintext_email = false
{%- endif %}
monochrome_logs = false
hook_url = null
{% if modules %}monochrome_logs = false{% endif %}
{% if slackreport or adaptivecard %}hook_url = null{% endif %}
{% if nf_schema %}help = false
help_full = false
show_hidden = false{% endif %}
Expand All @@ -62,9 +62,10 @@ params {
max_cpus = 16
max_time = '240.h'

{%- if nf_schema %}
// Schema validation default options
validate_params = true

{% endif %}
}
{% if modules %}
// Load base.config by default for all pipelines
Expand Down
12 changes: 7 additions & 5 deletions nf_core/pipeline-template/nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"fa_icon": "fas fa-question-circle",
"hidden": true
},
{%- if modules %}
"publish_dir_mode": {
"type": "string",
"default": "copy",
Expand All @@ -192,7 +193,7 @@
"fa_icon": "fas fa-copy",
"enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"],
"hidden": true
},{% if email %}
},{% endif %}{% if email %}
"email_on_fail": {
"type": "string",
"description": "Email address for completion summary, only when pipeline fails.",
Expand All @@ -215,21 +216,22 @@
"default": "25.MB",
"fa_icon": "fas fa-file-upload",
"hidden": true
},
{% endif %}
},{% endif %}
{%- if modules %}
"monochrome_logs": {
"type": "boolean",
"description": "Do not use coloured log outputs.",
"fa_icon": "fas fa-palette",
"hidden": true
},
},{% endif %}
{%- if slackreport or adaptivecard %}
"hook_url": {
"type": "string",
"description": "Incoming hook URL for messaging service",
"fa_icon": "fas fa-people-group",
"help_text": "Incoming hook URL for messaging service. Currently, MS Teams and Slack are supported.",
"hidden": true
},
},{% endif %}
{%- if multiqc %}
"multiqc_config": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
github:
skippable_paths:
- ".github/"
- ".gitignore"
short_description: "Skip the creation of a local Git repository."
description: ""
help_text: ""
- ".github"
- ".gitattributes"
short_description: "Use a GitHub repository."
description: "Create a GitHub repository for the pipeline."
help_text: |
This will create a GitHub repository for the pipeline.

The repository will include:
- Continuous Integration (CI) tests
- Issues and pull requests templates

The initialisation of a git repository is required to use the nf-core/tools.
This means that even if you unselect this option, your pipeline will still contain a `.git` directory and `.gitignore` file.
linting:
files_exist:
- ".github/ISSUE_TEMPLATE/bug_report.yml"
- ".github/ISSUE_TEMPLATE/feature_request.yml"
- ".github/PULL_REQUEST_TEMPLATE.md"
- ".github/CONTRIBUTING.md"
- ".github/.dockstore.yml"
- ".gitignore"
files_unchanged:
- ".github/ISSUE_TEMPLATE/bug_report.yml"
- ".github/ISSUE_TEMPLATE/config.yml"
Expand All @@ -26,7 +33,7 @@ github:
readme:
- "nextflow_badge"
nfcore_pipelines: False
custom_pipelines: False
custom_pipelines: True
ci:
skippable_paths:
- ".github/workflows/"
Expand Down Expand Up @@ -282,12 +289,22 @@ changelog:
nf_schema:
skippable_paths:
- "subworkflows/nf-core/utils_nfschema_plugin"
- "nextflow_schema.json"
- "assets/schema_input.json"
- "assets/samplesheet.csv"
short_description: "Use nf-schema"
description: "Use the nf-schema Nextflow plugin for this pipeline."
help_text: |
[nf-schema](https://nextflow-io.github.io/nf-schema/latest/) is used to validate input parameters based on a JSON schema.
It also provides helper functionality to create help messages, get a summary
of changed parameters and validate and convert a samplesheet to a channel.
linting:
files_exist:
- "nextflow_schema.json"
schema_params: False
schema_lint: False
schema_description: False
nextflow_config: False
nfcore_pipelines: True
custom_pipelines: True
license:
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/create/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def init_context(value: Dict[str, Any]) -> Iterator[None]:
NFCORE_PIPELINE_GLOBAL: bool = True

# YAML file describing template features
features_yml_path = Path(nf_core.__file__).parent / "pipelines" / "create" / "templatefeatures.yml"
features_yml_path = Path(nf_core.__file__).parent / "pipelines" / "create" / "template_features.yml"


class CreateConfig(NFCoreTemplateConfig):
Expand Down
Loading
Loading