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 option to exclude codespaces from pipeline template #3105

Merged
merged 5 commits into from
Aug 7, 2024
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
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
Loading