Skip to content

Commit

Permalink
Merge pull request #3105 from mirpedrol/template-customisation-codesp…
Browse files Browse the repository at this point in the history
…aces

Template: add option to exclude codespaces from pipeline template
  • Loading branch information
mirpedrol committed Aug 7, 2024
2 parents 614b79f + 19590c3 commit e4d6b21
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 256 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- "template_skip_code_linters.yml"
- "template_skip_citations.yml"
- "template_skip_gitpod.yml"
- "template_skip_codespaces.yml"
- "template_skip_multiqc.yml"
- "template_skip_changelog.yml"
runner:
Expand Down Expand Up @@ -127,6 +128,10 @@ jobs:
run: |
printf "org: my-prefix\nskip: changelog" > create-test-lint-wf/template_skip_changelog.yml
- name: Create template skip codespaces
run: |
printf "org: my-prefix\nskip: codespaces" > create-test-lint-wf/template_skip_codespaces.yml
# Create a pipeline from the template
- name: create a pipeline from the template ${{ matrix.TEMPLATE }}
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- add option to exclude code linters for custom pipeline template ([#3084](https://github.com/nf-core/tools/pull/3084))
- add option to exclude citations for custom pipeline template ([#3101](https://github.com/nf-core/tools/pull/3101))
- add option to exclude gitpod for custom pipeline template ([#3100](https://github.com/nf-core/tools/pull/3100))
- add option to exclude codespaces from pipeline template ([#3105](https://github.com/nf-core/tools/pull/3105))
- add option to exclude multiqc from pipeline template ([#3103](https://github.com/nf-core/tools/pull/3103))
- add option to exclude changelog from custom pipeline template ([#3104](https://github.com/nf-core/tools/pull/3104))

Expand Down
2 changes: 2 additions & 0 deletions nf_core/pipeline-template/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ If you are using a new feature from core Nextflow, you may bump the minimum requ
### Images and figures

For overview images and other documents we follow the nf-core [style guidelines and examples](https://nf-co.re/developers/design_guidelines).
{%- if codespaces %}

## GitHub Codespaces

Expand All @@ -133,3 +134,4 @@ To get started:
Devcontainer specs:

- [DevContainer config](.devcontainer/devcontainer.json)
{% endif %}
6 changes: 6 additions & 0 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def __init__(
],
"citations": ["assets/methods_description_template.yml"],
"gitpod": [".gitpod.yml"],
"codespaces": [".devcontainer/devcontainer.json"],
"multiqc": [
"assets/multiqc_config.yml",
"assets/methods_description_template.yml",
Expand Down Expand Up @@ -220,6 +221,7 @@ def obtain_jinja_params_dict(self, features_to_skip, pipeline_dir):
"code_linters": {"file": True, "content": True},
"citations": {"file": True, "content": True},
"gitpod": {"file": True, "content": True},
"codespaces": {"file": True, "content": True},
"multiqc": {"file": True, "content": True},
"changelog": {"file": True, "content": False},
}
Expand Down Expand Up @@ -520,6 +522,10 @@ def fix_linting(self):
if not self.jinja_params["github_badges"] or not self.jinja_params["github"]:
lint_config["readme"] = ["nextflow_badge"]

# Add codespaces specific configurations
if not self.jinja_params["codespaces"]:
lint_config["files_unchanged"].extend([".github/CONTRIBUTING.md"])

# Add multiqc specific configurations
if not self.jinja_params["multiqc"]:
lint_config.setdefault("files_unchanged", []).extend(
Expand Down
13 changes: 13 additions & 0 deletions nf_core/pipelines/create/custompipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
This is useful to have all the tools ready for pipeline development.
"""

markdown_codespaces = """
The pipeline will include a devcontainer configuration.
The devcontainer will create a GitHub Codespaces for Nextflow development with nf-core/tools and Nextflow installed.
Github Codespaces (https://github.com/features/codespaces) is an online developer environment that runs in your browser, complete with VSCode and a terminal.
"""

markdown_changelog = """
Having a `CHANGELOG.md` file in the pipeline root directory is useful to track the changes added to each version.
You can read more information on the recommended format here: https://keepachangelog.com/en/1.0.0/
Expand Down Expand Up @@ -127,6 +134,12 @@ def compose(self) -> ComposeResult:
"Include the configuration required to use Gitpod.",
"gitpod",
),
PipelineFeature(
markdown_codespaces,
"Include GitHub Codespaces",
"The pipeline will include a devcontainer configuration for GitHub Codespaces, providing a development environment with nf-core/tools and Nextflow installed.",
"codespaces",
),
PipelineFeature(
markdown_multiqc,
"Use multiqc",
Expand Down
512 changes: 256 additions & 256 deletions tests/__snapshots__/test_create_app.ambr

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/data/pipeline_create_template_skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ skip_features:
- code_linters
- citations
- gitpod
- codespaces
- multiqc
- changelog

0 comments on commit e4d6b21

Please sign in to comment.