-
Notifications
You must be signed in to change notification settings - Fork 223
Move CONTRIBUTING.md to docs/, review and update text, and add pipline-specific conventions section
#3903
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
Open
jfy133
wants to merge
11
commits into
nf-core:dev
Choose a base branch
from
jfy133:move-contributing
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+192
−142
Open
Move CONTRIBUTING.md to docs/, review and update text, and add pipline-specific conventions section
#3903
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d0a40db
Merge pull request #3833 from nf-core/dev
mirpedrol 99b23f0
Merge pull request #3838 from nf-core/dev
mashehu f7b967e
Move contributing to `docs/` and overhaul/review and add pipline-spe…
jfy133 1760476
Update CHANGELOG
jfy133 a320047
Update CHANGELOG.md
jfy133 f7e3f43
Merge branch 'dev' into move-contributing
jfy133 252497a
Update contributing following style guide (with secondary checks with…
jfy133 247f5a4
Apply suggestions from code review
jfy133 9b98292
Apply suggestions from code review
jfy133 e6aeadd
Merge remote-tracking branch 'origin' into move-contributing
jfy133 a0102aa
Minor tweaks
jfy133 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| --- | ||
| title: Contributing | ||
| markdownPlugin: checklist | ||
| --- | ||
|
|
||
| # `{{ name }}`: Contributing guidelines | ||
|
|
||
| Hi there! | ||
| Thanks for taking an interest in improving {{ name }}. | ||
|
|
||
| This page describes the recommended nf-core way to contribute to both {{ name }} and nf-core pipelines in general, including: | ||
|
|
||
| - [General contribution guidelines](#general-contribution-guidelines): for common procedures or guides across all nf-core pipelines. | ||
| - [Pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): for any procedures or guides specific to the development conventions of {{ name }}. | ||
|
|
||
| {% if is_nfcore -%} | ||
|
|
||
| > [!NOTE] | ||
| > If you need help using or modifying {{ name }}, ask on the nf-core Slack [#{{ short_name }}](https://nfcore.slack.com/channels/{{ short_name }}) channel ([join our Slack here](https://nf-co.re/join/slack)). | ||
|
|
||
| {% endif -%} | ||
|
|
||
| ## General contribution guidelines | ||
|
|
||
| ### Contribution quick start | ||
|
|
||
| To contribute code to any nf-core pipeline: | ||
|
|
||
| - [ ] Ensure you have Nextflow, nf-core tools, and nf-test installed. See the [nf-core/tools repository](https://github.com/nf-core/tools) for instructions. | ||
| - [ ] Check whether a GitHub [issue](https://github.com/{{ name }}/issues) about your idea already exists. If an issue does not exist, create one so that others are aware you are working on it. | ||
| - [ ] [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [{{ name }} repository](https://github.com/{{ name }}) to your GitHub account. | ||
| - [ ] Create a branch on your forked repository and make your changes following [pipeline conventions](#pipeline-contribution-conventions) (if applicable). | ||
| - [ ] To fix major bugs, name your branch `patch` and follow the [patch release](#patch-release) process. | ||
| - [ ] Update relevant documentation within the `docs/` folder, use nf-core/tools to update `nextflow_schema.json`, and update `CITATIONS.md`. | ||
| - [ ] Run and/or update tests. See [Testing](#testing) for more information. | ||
| - [ ] [Lint](#lint-tests) your code with nf-core/tools. | ||
| - [ ] Submit a pull request (PR) against the `dev` branch and request a review. | ||
|
|
||
| If you are not used to this workflow with Git, see the [GitHub documentation](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or [Git resources](https://try.github.io/) for more information. | ||
|
|
||
| {% if is_nfcore -%} | ||
|
|
||
| ### Getting help | ||
|
|
||
| For further information and help, see the [{{ name }} documentation](https://nf-co.re/{{ short_name }}/usage) or ask on the nf-core [#{{ short_name }}](https://nfcore.slack.com/channels/{{ short_name }}) Slack channel ([join our Slack here](https://nf-co.re/join/slack)). | ||
|
|
||
| {% endif -%} | ||
|
|
||
| {%- if codespaces %} | ||
|
|
||
| ### GitHub Codespaces | ||
|
|
||
| You can contribute to {{ name }} without installing a local development environment on your machine by using [GitHub Codespaces](https://github.com/codespaces). | ||
|
|
||
| [GitHub Codespaces](https://github.com/codespaces) is an online developer environment that runs in your browser, complete with VS Code and a terminal. | ||
| Most nf-core repositories include a devcontainer configuration, which creates a GitHub Codespaces environment specifically for Nextflow development. | ||
| The environment includes pre-installed nf-core tools, Nextflow, and a few other helpful utilities via a Docker container. | ||
|
|
||
| To get started, open the repository in [Codespaces](https://github.com/{{ name }}/codespaces). | ||
| {%- endif %} | ||
|
|
||
| ### Testing | ||
|
|
||
| {% if test_config -%} | ||
| Once you have made your changes, run the pipeline with nf-test to test them locally. | ||
| We recommend the `--verbose` flag to view the Nextflow console log output in addition to the output from nf-test. | ||
|
|
||
| ```bash | ||
| nf-test test --tag test --profile +docker --verbose | ||
| ``` | ||
|
|
||
| If you have added new functionality, ensure you update the test assertions in the `.nf.test` files in the `tests/` directory. | ||
| Update the snapshots with the following command: | ||
|
|
||
| ```bash | ||
| nf-test test --tag test --profile +docker --verbose --update-snapshots | ||
| ``` | ||
|
|
||
| {% endif -%} | ||
|
|
||
| When you create a pull request with changes, GitHub Actions will run automatic tests. | ||
| Pull requests are typically reviewed when these tests are passing. | ||
|
|
||
| {% if test_config %}Two types of tests are typically run:{% endif %} | ||
|
|
||
| #### Lint tests | ||
|
|
||
| nf-core has a [set of guidelines](https://nf-co.re/docs/contributing/guidelines) which all pipelines must follow. | ||
| To enforce these, run linting with nf-core/tools: | ||
|
|
||
| ```bash | ||
| nf-core pipelines lint <pipeline_directory> | ||
| ``` | ||
|
|
||
| If you encounter failures or warnings, follow the linked documentation printed to screen. | ||
| For more information about linting tests, see [nf-core/tools API documentation](https://nf-co.re/docs/nf-core-tools/api_reference/latest/pipeline_lint_tests/actions_awsfulltest). | ||
|
|
||
| {%- if test_config %} | ||
|
|
||
| #### Pipeline tests | ||
|
|
||
| Each nf-core pipeline should be set up with a minimal set of test data. | ||
| GitHub Actions runs the pipeline on this data to ensure it runs through and exits successfully. | ||
| If there are any failures then the automated tests fail. | ||
| These tests are run with the latest available version of Nextflow and the minimum required version specified in the pipeline code. | ||
| {%- endif %} | ||
|
|
||
| ### Patch release | ||
|
|
||
| > [!WARNING] | ||
| > Only in the unlikely event of a release that contains a critical bug. | ||
|
|
||
| - [ ] Create a new branch `patch` on your fork based on `upstream/main` or `upstream/master`. | ||
| - [ ] Fix the bug and use nf-core/tools to bump the version to the next semantic version, for example, `1.2.3` → `1.2.4`. | ||
| - [ ] Open a Pull Request from `patch` directly to `main`/`master` with the changes. | ||
|
|
||
| ### Pipeline contribution conventions | ||
|
|
||
| To make the `{{ name }}` code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written. | ||
|
|
||
| #### Add a new pipeline step | ||
|
|
||
| To contribute a new step to the pipeline, follow the general nf-core coding procedure. | ||
| Please also refer to the [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines): | ||
|
|
||
| - [ ] Define the corresponding [input channel](#channel-naming-schemes) into your new process from the expected previous process channel. | ||
| - [ ] Install a module with nf-core/tools, or write a local module (see [default processes resource requirements](#default-processes-resource-requirements)), and add it to the target `<workflow>.nf`. | ||
| - [ ] Define the output channel if needed. Mix the version output channel into `ch_versions` and relevant files into `ch_multiqc`. | ||
| - [ ] Add new or updated parameters to `nextflow.config` with a [default value](#default-parameter-values). | ||
| - [ ] Add new or updated parameters and relevant help text to `nextflow_schema.json` with [nf-core/tools](#default-parameter-values). | ||
| - [ ] Add validation for relevant parameters to the pipeline utilisation section of `utils_nfcore_{{ shortname }}\_pipeline/main.nf` subworkflow. | ||
| - [ ] Perform local tests to validate that the new code works as expected. | ||
| - [ ] If applicable, add a new test in the `tests` directory. | ||
| - [ ] Update `usage.md`, `output.md`, and `citation.md` as appropriate. | ||
| - [ ] [Lint](lint) the code with nf-core/tools. | ||
| - [ ] Update any diagrams or pipeline images as necessary. | ||
| {%- if multiqc %} | ||
| - [ ] Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name cleanup, and module plots are in the appropriate order. | ||
| - [ ] If applicable, create a [MultiQC](https://seqera.io/multiqc/) module. | ||
| - [ ] Add a description of the output files and, if relevant, images from the MultiQC report to `docs/output.md`. | ||
| {%- endif %} | ||
|
|
||
| To update the minimum required Nextflow version, see the [Nextflow version bumping](#nextflow-version-bumping) section below. For more information about pipeline contributions, see [pipeline-specific contribution guidelines](#pipeline-specific-contribution-guidelines). | ||
|
|
||
| #### Channel naming schemes | ||
|
|
||
| Use the following naming schemes for channels to make the channel flow easier to understand: | ||
|
|
||
| - Initial process channel: `ch_output_from_<process>` | ||
| - Intermediate and terminal channels: `ch_<previousprocess>_for_<nextprocess>` | ||
|
|
||
| #### Default parameter values | ||
|
|
||
| Parameters should be initialised and defined with default values within the `params` scope in `nextflow.config`. | ||
jfy133 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| They should also be documented in the pipeline JSON schema. | ||
|
|
||
| To update `nextflow_schema.json`, run: | ||
|
|
||
| ```bash | ||
| nf-core pipelines schema build | ||
| ``` | ||
|
|
||
| The schema builder interface that loads in your browser should automatically update the defaults in the parameter documentation. | ||
|
|
||
| #### Default processes resource requirements | ||
|
|
||
| If you write a local module, specify a default set of resource requirements for the process. | ||
|
|
||
| Sensible defaults for process resource requirements (CPUs, memory, time) should be defined in `conf/base.config`. | ||
| Specify these with generic `withLabel:` selectors, so they can be shared across multiple processes and steps of the pipeline. | ||
|
|
||
| nf-core provides a set of standard labels that you should follow where possible, as seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config). | ||
| These labels define resource defaults for single-core processes, modules that require a GPU, and different levels of multi-core configurations with increasing memory requirements. | ||
|
|
||
| Values assigned within these labels can be dynamically passed to a tool using the the `${task.cpus}` and `${task.memory}` Nextflow variables in the `script:` block of a module (see an example in the [modules repository](https://github.com/nf-core/modules/blob/bd1b6a40f55933d94b8c9ca94ec8c1ea0eaf4b82/modules/nf-core/samtools/bam2fq/main.nf#L30)). | ||
|
|
||
| #### Nextflow version bumping | ||
|
|
||
| If you use a new feature from core Nextflow, bump the minimum required Nextflow version in the pipeline with: | ||
|
|
||
| ```bash | ||
| nf-core pipelines bump-version --nextflow . <min_nf_version> | ||
| ``` | ||
|
|
||
| #### Images and figures guidelines | ||
|
|
||
| If you update images or graphics, follow the nf-core [style guidelines](https://nf-co.re/docs/guidelines/graphic_design/overview). | ||
|
|
||
| ## Pipeline specific contribution guidelines | ||
|
|
||
| <!-- TODO nf-core: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc. --> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.