Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
552 commits
Select commit Hold shift + click to select a range
2ac3ec9
Update pytest with fixed schema
ewels Jun 24, 2020
c9edff2
Launch - check required before leaving group prompt
ewels Jun 24, 2020
c46eea2
Launch: Check that we can find the supplied pipeline before trying to…
ewels Jun 24, 2020
1f78525
Scrape parameters from main.nf
ewels Jun 24, 2020
95c9782
Add params.fasta to template schema
ewels Jun 24, 2020
d89850b
Allow whitespace at the start of the line when defining params in mai…
ewels Jun 24, 2020
81ca05b
Merge pull request #626 from ewels/schema_launch_updates
ewels Jun 24, 2020
2a580a8
Refactor functionality to poll nf-core website API and wait
ewels Jun 24, 2020
6a3db62
First iteration of nf-core launch web GUI
ewels Jun 25, 2020
a0e31b0
Launch - updates for web GUI
ewels Jun 26, 2020
0be243b
Launch: Check if params file exists.
ewels Jun 26, 2020
c6c4078
Launch: send core nf-core and nextflow commands to launcher
ewels Jun 26, 2020
d54f746
Fix launch cli --url default
ewels Jun 27, 2020
b09f55e
PyInquirer setup.py - try archive link
ewels Jun 29, 2020
a6b40cc
Fix schema tests
ewels Jun 29, 2020
c7d744b
Update launch tests for new boolean style
ewels Jun 29, 2020
068e374
Never prompt for revision in schema
ewels Jun 29, 2020
2f504b1
Launch - new tests
ewels Jun 29, 2020
b5f50a3
Launch - another test
ewels Jun 29, 2020
5bd2c41
Rename launch url, support launching with just ID
ewels Jun 29, 2020
0f1e05d
Fix bug and tests - wrong variable name
ewels Jun 29, 2020
f96de8d
Launch: more tests
ewels Jun 29, 2020
0eca7bc
More tests
ewels Jun 29, 2020
b1d18d9
Launch - test launch_pipeline()
ewels Jun 29, 2020
d821b81
Merge pull request #638 from ewels/launch-web-gui
ewels Jun 30, 2020
819819f
Add missing content type definition for mailutils email server emails
jfy133 Jun 30, 2020
847938d
Update CHANGELOG.md
jfy133 Jun 30, 2020
aa8f413
Update CHANGELOG.md
jfy133 Jun 30, 2020
f52e3ba
Try to improve command line help for nf-core launch
ewels Jun 30, 2020
860e101
Update to use html instead
jfy133 Jun 30, 2020
190f462
Merge pull request #642 from nf-core/jfy133-patch-1
jfy133 Jun 30, 2020
7041b51
Added configFiles information to summary
skrakau Jul 2, 2020
12c531d
Update CHANGELOG
skrakau Jul 2, 2020
bb0a116
Fix Slack badge
drpatelh Jul 2, 2020
200dd6f
Update CHANGELOG
drpatelh Jul 2, 2020
024120f
Merge pull request #645 from drpatelh/slack_badge
ewels Jul 2, 2020
f933de0
Update nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf
skrakau Jul 2, 2020
3aebc96
Merge pull request #644 from skrakau/add_configfiles_to_summary
skrakau Jul 2, 2020
ab8e3c6
Fix merge conflicts
drpatelh Jul 6, 2020
465b5a2
Replace reads with input in schema
drpatelh Jul 6, 2020
784874e
Make input required
drpatelh Jul 6, 2020
48f77b3
Replace reads with input in README
drpatelh Jul 6, 2020
8d508d8
Apply suggestions from code review
ewels Jul 6, 2020
2b92b3d
Update minimal working example
drpatelh Jul 6, 2020
cc1268f
Update test_launch.py and test_schema.py
drpatelh Jul 6, 2020
1db6009
Merge pull request #643 from ewels/improve-cli-help
ewels Jul 6, 2020
26ed124
Fix test_launch error
drpatelh Jul 6, 2020
c531e50
Update test pass numbers
drpatelh Jul 6, 2020
d1252c2
Add singleEnd to lint
drpatelh Jul 6, 2020
a507a1c
Update lint pass numbers
drpatelh Jul 6, 2020
8909da3
Update pass numbers
drpatelh Jul 6, 2020
6fe5943
Update CHANGELOG
drpatelh Jul 6, 2020
b0bd706
Merge pull request #556 from drpatelh/master
drpatelh Jul 6, 2020
a43b889
Write a lot more cli help text
ewels Jul 8, 2020
5a07fcb
Changelog update
ewels Jul 8, 2020
c7d9ef6
Update example output in readme
ewels Jul 8, 2020
1b3cb5c
Missed a couple
ewels Jul 8, 2020
7977125
[FEATURE] Included rich library. Started with displaying MD during la…
Jul 8, 2020
98c20bf
Style
Jul 8, 2020
f9a4c67
Added -y flag to apt-get clean
chris-cheshire Jul 9, 2020
00d158d
Merge pull request #633 from luslab/dev
ewels Jul 9, 2020
fd1241e
Fix PyInquirer
ewels Jul 9, 2020
cbf01f6
Fix tests
ewels Jul 9, 2020
24b2a43
Merge pull request #659 from ewels/fix-pyinquirer
ewels Jul 9, 2020
54f99ea
run Black, line length 120
ewels Jul 9, 2020
1c87e87
Merge branch 'master' into feature/richMD
ewels Jul 9, 2020
7528295
Tweak help text formatting
ewels Jul 9, 2020
3bdbc4a
Merge pull request #657 from jpfeuffer/feature/richMD
ewels Jul 9, 2020
acc2da8
Add new GitHub Actions workflow for linting Python code
ewels Jul 9, 2020
66a3573
Rename code-tests.yml
ewels Jul 9, 2020
602804a
Rename pytest job
ewels Jul 9, 2020
bf3e102
Update scripts/nf-core
ewels Jul 9, 2020
949b9c4
Merge pull request #655 from ewels/better-help-text
ewels Jul 9, 2020
2c45fd0
Fix merge conflicts
ewels Jul 9, 2020
167807d
Add Black config file
ewels Jul 9, 2020
b6fccf8
Black lint
ewels Jul 9, 2020
b68afe0
Tweak flake8 tests
ewels Jul 9, 2020
3507088
Ditch the flake8 stuff for now
ewels Jul 9, 2020
22c641f
Update changelog, CONTRIBUTING.md
ewels Jul 9, 2020
0e04a60
Merge pull request #658 from ewels/python-black
ewels Jul 9, 2020
33e2fbc
Add badge to readme for Black code formatter
ewels Jul 9, 2020
a4911d8
Merge pull request #660 from ewels/black-badge
ewels Jul 9, 2020
84d7ff8
Launch: Fix bug when sanitising empty strings from the web
ewels Jul 9, 2020
807ce71
Launch: Simplify / refactor code when a web ID is supplied
ewels Jul 9, 2020
bac4e09
Revert KeyError back to AssertionError
ewels Jul 9, 2020
e9b1868
Remove test that is now a bit pointless
ewels Jul 9, 2020
f4ed176
Write a couple of new tests
ewels Jul 9, 2020
1f0d299
Merge pull request #661 from ewels/launch-bugfix
ewels Jul 9, 2020
b44e526
Merge branch 'master' into module-import
ewels Jul 11, 2020
8f1dcbe
Black: modules.py
ewels Jul 11, 2020
e91d2e0
Module import: rename tools to software
ewels Jul 11, 2020
a857c6c
Apply Black code formatting to scripts/nf-core too
ewels Jul 11, 2020
4380008
scripts: Use rich for ascii header formatting
ewels Jul 11, 2020
0db8e1a
Move scripts/nf-core to nf_core/__main__.py
ewels Jul 11, 2020
66fdab3
Use entry_points instead of script for main cli
ewels Jul 11, 2020
7a2ab27
Added very basic tests for cli script
ewels Jul 11, 2020
6f1eb57
Fix typo in tests
ewels Jul 11, 2020
7eeae29
Merge pull request #662 from ewels/format-scripts
ewels Jul 11, 2020
9dc70cf
merge upstream
ewels Jul 11, 2020
9345b9b
Re-order nf-core help subcommands
ewels Jul 11, 2020
51aaa50
Modules: Improve help text.
ewels Jul 11, 2020
d7ddaaf
Modules: continue removing use of 'tool' in code
ewels Jul 11, 2020
813d0a6
Get modules - allow nested module directory structure
ewels Jul 11, 2020
54f6164
Clarify modules repo variable names.
ewels Jul 13, 2020
47393ca
Modules install improvements
ewels Jul 13, 2020
1c22055
Modules: Add some tests
ewels Jul 13, 2020
b12a82e
Update modules subcommands to take a pipeline dir path
ewels Jul 13, 2020
5f03a4d
Merge pull request #615 from nf-core/module-import
ewels Jul 13, 2020
a7c5423
Schema build - extra help if running offline
ewels Jul 13, 2020
8f3c482
Merge pull request #666 from ewels/schema-build-nointernet
ewels Jul 13, 2020
7a34c17
hide archived workflows by default in 'list'
stevekm Jul 13, 2020
fbaf17b
add test to show archived workflows
stevekm Jul 13, 2020
1acb818
Remove double-log, handle PR exception in a nicer way
ewels Jul 14, 2020
d516657
Black formatting
ewels Jul 14, 2020
0962d82
Black for tests too
ewels Jul 14, 2020
b13c678
Fix list filter, improve styling
ewels Jul 14, 2020
ff841e9
List: return string and print from cli
ewels Jul 14, 2020
726f898
Fix nf-core list JSON output & tests
ewels Jul 14, 2020
9c497b3
Readme and changelog
ewels Jul 14, 2020
61a2ccc
Merge pull request #671 from stevekm/hide-archived-workflows
ewels Jul 14, 2020
0108077
Better log colours
ewels Jul 14, 2020
c59f2b1
Sync PR - tidy code, allow maintainer to modify
ewels Jul 14, 2020
91dcd5d
add functions for checking outdated versions
stevekm Jul 14, 2020
87f482a
add version checking to the command line invocation
stevekm Jul 14, 2020
e735bb2
update remote version URL and add environment variable overrides for …
stevekm Jul 14, 2020
31a1412
Sync: Start writing some tests
ewels Jul 14, 2020
e0181d1
fix code formatting
stevekm Jul 14, 2020
b6cbd0e
use requests to get version
stevekm Jul 14, 2020
3268843
Sync - new test for fetching origin
ewels Jul 15, 2020
5249693
Sync: Remove functionality to create an orphan TEMPLATE branch
ewels Jul 15, 2020
a1e6835
Sync - more cleanup, more tests
ewels Jul 15, 2020
136166d
MOAR TESTS
ewels Jul 15, 2020
cf769e0
Small refactor, big bold yellow text
ewels Jul 15, 2020
653bf94
Readme and docs
ewels Jul 15, 2020
afceb7f
Merge pull request #672 from ewels/sync_improvements
ewels Jul 15, 2020
5a3dad1
Grey text, not black
ewels Jul 15, 2020
80d675f
Set max timeout to 3 seconds for version check
ewels Jul 15, 2020
4846c0f
Merge pull request #675 from stevekm/check-tool-release
ewels Jul 15, 2020
7577b08
modules install to nf-core subfolder
ewels Jul 15, 2020
de58169
Merge pull request #676 from ewels/modules-install-subfolder
drpatelh Jul 15, 2020
ba1725e
Use rich for linting progress bar and tracebacks
ewels Jul 15, 2020
f654d50
Lint progress bar - show function name
ewels Jul 15, 2020
4d73bde
make json-schema template more human-readable.
Jul 15, 2020
28d8d0d
Merge pull request #677 from ewels/rich-lint-progress
Zethson Jul 15, 2020
520f8f1
Merge pull request #678 from mashehu/dev
ewels Jul 15, 2020
048f525
Amazing lint formatting
ewels Jul 15, 2020
f6a8a33
Use markdown rendering for lint results
ewels Jul 15, 2020
26b4081
Lint: Show full URLs again
ewels Jul 16, 2020
1e8a25a
Rich - list pipelines
ewels Jul 16, 2020
8d031d8
Update list tests
ewels Jul 16, 2020
dc8d453
Merge pull request #679 from ewels/rich-lint-progress
drpatelh Jul 16, 2020
7874b8b
Slight tweak to main lint results output
ewels Jul 16, 2020
400e33e
Merge pull request #680 from ewels/rich-lint-progress
ewels Jul 16, 2020
66aa194
Use rich logging and terminal styling
ewels Jul 16, 2020
a4937c1
Fix overzealous find and replace
ewels Jul 16, 2020
4b9fbd6
Refactor nf-core licences code
ewels Jul 16, 2020
34bd0b3
GitHub actions - try to run as many nf-core commands as possible
ewels Jul 16, 2020
ae64bd3
Modules install - add some logging
ewels Jul 16, 2020
edf608a
Another test nf-core command
ewels Jul 16, 2020
d65ef13
Rich log to stderr, not stdout
ewels Jul 16, 2020
fd0a90c
Fix and improve tests for licences
ewels Jul 16, 2020
11502d1
Add codecov config file to avoid stupid CI fails
ewels Jul 16, 2020
04d0312
Just totally disable patch CI codecov checks
ewels Jul 16, 2020
08d9de1
Lint progress bar - don't print a second time after we break for a se…
ewels Jul 16, 2020
a5e2ebd
Use logger with __name__
ewels Jul 17, 2020
60a43eb
Use named loggers to control output
ewels Jul 17, 2020
c46fc9b
Made lint output EVEN MORE AWESOME
ewels Jul 17, 2020
9d51442
Fix log handler names
ewels Jul 17, 2020
5b49591
Update changelog
ewels Jul 17, 2020
bf950c9
Merge pull request #681 from ewels/rich-not-click
drpatelh Jul 17, 2020
42b84dc
Do not use pre-release PyInquirer
ewels Jul 21, 2020
372b6a4
Pin PyInquirer==1.0.2
ewels Jul 21, 2020
9add544
update json-schema template to new structure
Jul 22, 2020
38776e5
Fix tests
ewels Jul 23, 2020
1b61878
Use Rich.prompt Confirm.ask instead of click.confirm
ewels Jul 23, 2020
4e9881e
Better error log message
ewels Jul 23, 2020
36285f3
Struggling with rich.prompt tests
ewels Jul 23, 2020
5cce6b9
IT WAS .F NOT JUST F IT WAS FINE THE WHOLE TIME ARGHHHGH
ewels Jul 23, 2020
c5df496
Add requirements-dev.txt
ewels Jul 23, 2020
4ead4db
Docs for requirements-dev.txt
ewels Jul 23, 2020
7165f61
Add pytest-datafiles back
ewels Jul 23, 2020
8005c09
Surely the order isn't important..?
ewels Jul 23, 2020
9eb2ec3
Update nf_core/launch.py
apeltzer Jul 23, 2020
02593c5
Merge pull request #684 from ewels/pyinquirer-stable
apeltzer Jul 23, 2020
290669d
Lint TODO - ignore editor files
ewels Jul 23, 2020
b3c9ce4
Changelog
ewels Jul 23, 2020
c33b401
Add Dockstore config file to template
ewels Jul 23, 2020
cbf86a5
Changelog update
ewels Jul 23, 2020
b0a3cbb
update incorrect link to igenomes conf
Jul 23, 2020
6b84b54
Merge pull request #691 from mashehu/update_links
ewels Jul 23, 2020
33cd975
Use new Rich syntax for markup logs.
ewels Jul 23, 2020
8a3ec77
Merge pull request #688 from mashehu/dev
ewels Jul 24, 2020
5218db5
Merge pull request #692 from ewels/rich-cleaner-logging
ewels Jul 27, 2020
d9e4c3d
update json-schema template to new structure
Jul 22, 2020
ae2c168
Don't flatten the schema
ewels Jul 24, 2020
1c2a41e
Schema - fix validation for new 'definitions' grouping
ewels Jul 27, 2020
8b62ac5
Count the parameters when validating a schema
ewels Jul 27, 2020
0f5ef58
nf-core schema validate - use position arg for input JSON
ewels Jul 27, 2020
6a9ef3c
Schema build to work with new 'definitions' groups
ewels Jul 27, 2020
f2d829e
Schema validate - check at least one parameter
ewels Jul 27, 2020
a3b8835
Update tests for nf-core schema
ewels Jul 27, 2020
ca50bea
Fix typo in bump_versions tests
ewels Jul 27, 2020
5898ff1
Get download and lint tests working again
ewels Jul 27, 2020
1cfc1f3
Schema validate - check for duplicate param IDs in subschema
ewels Jul 27, 2020
9e8d70a
Schema validate: check definitions and allOf
ewels Jul 27, 2020
c6c4874
Get nf-core launch working with new schema structure
ewels Jul 27, 2020
96a4607
Update tests for new launch modifications
ewels Jul 27, 2020
4e07b97
List tests - avoid messing with NXF_ASSETS env var
ewels Jul 27, 2020
95ef592
added some more docs to the lint errors markdown
ewels Jul 27, 2020
6a73812
Change URL for pipeline schema builder
ewels Jul 27, 2020
7ad8538
Schema - fix behaviour of using the defaults dict to list discovered …
ewels Jul 27, 2020
2c6d49e
Better loading text screen-writing for function that waits for the web
ewels Jul 27, 2020
a9a941e
Add some assertion test messages to schema
ewels Jul 27, 2020
d47ab05
Don't print lint results when bumping versions
ewels Jul 27, 2020
53e5f8a
Update example outputs in README
ewels Jul 27, 2020
df976ff
Merge pull request #689 from ewels/lint-ignore-editorfiles
ewels Jul 27, 2020
b274133
Rename copypasta error in GitHub action
ewels Jul 27, 2020
66968f5
Extra schema linting checks
ewels Jul 28, 2020
56090b6
Move dockerhub GitHub action into its own file
ewels Jul 28, 2020
394b575
Fix dodgy .gitignore file patterns
ewels Jul 28, 2020
ec5ee05
Update nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.githu…
ewels Jul 28, 2020
a6d6efd
Merge pull request #697 from ewels/dockerhub_ci_actions
ewels Jul 28, 2020
52179ca
Merge branch 'master' into new-new-schema
ewels Jul 28, 2020
e507baa
Fix minimal example schema file
ewels Jul 28, 2020
8851af8
Relax cli test slightly
ewels Jul 28, 2020
6219274
Merge pull request #695 from ewels/new-new-schema
apeltzer Jul 28, 2020
ca77a53
Merge pull request #698 from nf-core/new-new-schema
ewels Jul 29, 2020
f585505
Template schema back to 4-space padding again
ewels Jul 29, 2020
fc25c93
Tidy up code for generating new schema from scratch
ewels Jul 29, 2020
70f1b3c
Validate new schema when created from scratch
ewels Jul 29, 2020
360c749
Get schema defaults after making skeleton schema
ewels Jul 29, 2020
a0a6689
More whitespace for schema build launch confirm prompt
ewels Jul 29, 2020
24aa954
Merge pull request #699 from ewels/schema-build-bug
ewels Jul 29, 2020
2bdb026
Schema lint - warn about invalid title + description
ewels Jul 29, 2020
878f841
Update tests
ewels Jul 29, 2020
aac5185
Merge pull request #701 from ewels/schema-lint-warn
ewels Jul 29, 2020
50587d7
Merge pull request #690 from ewels/dockstore-config
ewels Jul 29, 2020
aafb41c
Revert extra whitespace for schema web builder prompt
ewels Jul 29, 2020
c55255a
Merge pull request #702 from ewels/master
ewels Jul 29, 2020
4368b2f
Start stripping out parameter docs from usage.md
ewels Jul 22, 2020
e0c284a
Strip more usage docs and update schema
ewels Jul 30, 2020
37d1d6f
Strip aws_batch params from schema
ewels Jul 30, 2020
f3aea54
Strip usage ToC and rewrite docs about detaching nextflow from the te…
ewels Jul 30, 2020
4e28e97
Add back the h1 to usage.md
ewels Jul 30, 2020
f3183de
Reword the usage.md TODO
ewels Jul 30, 2020
15b8294
Update nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextfl…
ewels Jul 30, 2020
cb72dda
Schema - iGenomes - add link to website docs
ewels Jul 30, 2020
9bbced4
Merge pull request #700 from ewels/strip-params-docs
ewels Jul 30, 2020
ac7b569
Bump to v1.10 - Copper Camel
ewels Jul 30, 2020
bd0fbe2
Merge pull request #704 from ewels/bump-1.10
ewels Jul 30, 2020
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
72 changes: 46 additions & 26 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,90 @@

Hi there! Many thanks for taking an interest in improving nf-core/tools.

We try to manage the required tasks for nf-core/tools using GitHub issues, you probably came to this page when creating one. Please use the pre-filled templates to save time.

However, don't be put off by this template - other more general issues and suggestions are welcome! Contributions to the code are even more welcome ;)

> If you need help using or developing nf-core/tools then the best place to ask is the nf-core `tools` channel on [Slack](https://nf-co.re/join/slack/).
If you need help then the best place to ask is the [`#tools` channel](https://nfcore.slack.com/channels/tools) on the nf-core Slack.
You can get an invite on the [nf-core website](https://nf-co.re/join/slack/).

## Contribution workflow

If you'd like to write some code for nf-core/tools, the standard workflow
is as follows:

1. Check that there isn't already an issue about your idea in the
[nf-core/tools issues](https://github.com/nf-core/tools/issues) to avoid
duplicating work.
1. Check that there isn't [already an issue](https://github.com/nf-core/tools/issues) about your idea to avoid duplicating work.
* If there isn't one already, please create one so that others know you're working on this
2. Fork the [nf-core/tools repository](https://github.com/nf-core/tools) to your GitHub account
3. Make the necessary changes / additions within your forked repository
4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged.

If you're not used to this workflow with git, you can start with some [basic docs from GitHub](https://help.github.com/articles/fork-a-repo/) or even their [excellent interactive tutorial](https://try.github.io/).
If you're not used to this workflow with git, you can start with some [basic docs from GitHub](https://help.github.com/articles/fork-a-repo/).

## Style guide
Google provides an excellent [style guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md), which
is a best practise extension of [PEP](https://www.python.org/dev/peps/), the Python Enhancement Proposals. Have a look at the
[docstring](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings) section, which is in particular
important, as nf-core tool's code documentation is generated out of these automatically.
## Installing dev requirements

In order to test the documentation, you have to install Sphinx on the machine, where the documentation should be generated.
If you want to work with developing the nf-core/tools code, you'll need a couple of extra Python packages.
These are listed in `requirements-dev.txt` and can be installed as follows:

Please follow Sphinx's [installation instruction](http://www.sphinx-doc.org/en/master/usage/installation.html).
```bash
pip install --upgrade -r requirements-dev.txt
```

Once done, you can run `make clean` and then `make html` in the root directory of `nf-core tools`, where the `Makefile` is located.
Then install your local fork of nf-core/tools:

The HTML will then be generated in `docs/api/_build/html`.
```bash
pip install -e .
```

## Code formatting with Black

All Python code in nf-core/tools must be passed through the [Black Python code formatter](https://black.readthedocs.io/en/stable/).
This ensures a harmonised code formatting style throughout the package, from all contributors.

You can run Black on the command line (it's included in `requirements-dev.txt`) - eg. to run recursively on the whole repository:

```bash
black .
```

Alternatively, Black has [integrations for most common editors](https://black.readthedocs.io/en/stable/editor_integration.html)
to automatically format code when you hit save.
You can also set it up to run when you [make a commit](https://black.readthedocs.io/en/stable/version_control_integration.html).

There is an automated CI check that runs when you open a pull-request to nf-core/tools that will fail if
any code does not adhere to Black formatting.

## API Documentation

We aim to write function docstrings according to the [Google Python style-guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings). These are used to automatically generate package documentation on the nf-core website using Sphinx.
You can find this documentation here: [https://nf-co.re/tools-docs/](https://nf-co.re/tools-docs/)

If you would like to test the documentation, you can install Sphinx locally by following Sphinx's [installation instruction](https://www.sphinx-doc.org/en/master/usage/installation.html).
Once done, you can run `make clean` and then `make html` in the root directory of `nf-core tools`.
The HTML will then be generated in `docs/api/_build/html`.

## Tests

When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests.
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.

There are two types of tests that run:

### Unit Tests

The nf-core tools package has a set of unit tests bundled, which can be found in the `tests/` directory.
New features should also come with new tests, to keep the test-coverage high (we use [codecov.io](https://codecov.io/gh/nf-core/tools/) to check this automatically).

You can try running the tests locally before pushing code using the following command:

```bash
python -m pytest .
pytest --color=yes tests/
```

### Lint Tests
nf-core has a [set of guidelines](http://nf-co.re/guidelines) which all pipelines must adhere to.
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core lint <pipeline-directory>` command.

The nf-core/tools repo itself contains the master template for creating new nf-core pipelines.
Once you have created a new pipeline from this template GitHub Actions is automatically set up to run lint tests on it.
nf-core/tools contains both the main nf-core template for pipelines and the code used to test that pipelines adhere to the nf-core guidelines.
As these two commonly need to be edited together, we test the creation of a pipeline and then linting using a CI check.
This ensures that any changes we make to either the linting or the template stay in sync.
You can replicate this process locally with the following commands:

```bash
nf-core create -n testpipeline -d "This pipeline is for testing"
nf-core lint nf-core-testpipeline
```

## Getting help
For further information/help, please consult the [nf-core/tools documentation](https://github.com/nf-core/tools#documentation) and don't hesitate to get in touch on the nf-core `tools` channel on [Slack](https://nf-co.re/join/slack/).
15 changes: 10 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<!--
Many thanks for contributing to nf-core/tools!

Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested on pull requests (PRs).
Please fill in the appropriate checklist below (delete whatever is not relevant).
These are the most common things requested on pull requests (PRs).

Remember that PRs should be made against the dev branch, unless you're preparing a release.

Learn more about contributing: https://github.com/nf-core/tools/tree/master/.github/CONTRIBUTING.md
-->

## PR checklist

- [ ] This comment contains a description of changes (with reason)
- [ ] `CHANGELOG.md` is updated
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] Documentation in `docs` is updated
- [ ] `CHANGELOG.md` is updated
- [ ] `README.md` is updated

**Learn more about contributing:** https://github.com/nf-core/tools/tree/master/.github/CONTRIBUTING.md
12 changes: 6 additions & 6 deletions .github/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Before release

1. Check issue milestones to see outstanding issues to resolve if possible or transfer to the milestones for the next release e.g. [`v1.9`](https://github.com/nf-core/tools/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.9)
2. Create a PR to `dev` to bump the version in `CHANGELOG.md` and `setup.py`.
3. Make sure all CI tests are passing!
4. Create a PR from `dev` to `master`
5. Make sure all CI tests are passing again (additional tests are run on PRs to `master`)
6. Request review (2 approvals required)
7. Most importantly, pick an undeniably outstanding [name](http://www.codenamegenerator.com/) for the release where *Prefix* = *Metal* and *Dictionary* = *Animal*.
2. Most importantly, pick an undeniably outstanding [name](http://www.codenamegenerator.com/) for the release where *Prefix* = *Metal* and *Dictionary* = *Animal*.
3. Create a PR to `dev` to bump the version in `CHANGELOG.md` and `setup.py`.
4. Make sure all CI tests are passing!
5. Create a PR from `dev` to `master`
6. Make sure all CI tests are passing again (additional tests are run on PRs to `master`)
7. Request review (2 approvals required)
8. Merge the PR into `master`
9. Once CI tests on commit have passed, create a new release copying the `CHANGELOG` for that release into the description section.

Expand Down
8 changes: 5 additions & 3 deletions .github/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Markdownlint configuration file
default: true,
default: true
line-length: false
no-duplicate-header:
siblings_only: true
no-bare-urls: false # tools only - the {{ jinja variables }} break URLs and cause this to error
commands-show-output: false # tools only - suppresses error messages for usage of $ in main README
# tools only - the {{ jinja variables }} break URLs and cause this to error
no-bare-urls: false
# tools only - suppresses error messages for usage of $ in main README
commands-show-output: false
35 changes: 35 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: nf-core branch protection
# This workflow is triggered on PRs to master branch on the repository
# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev`
on:
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:

# PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches
- name: Check PRs
if: github.repository == 'nf-core/tools'
run: |
{ [[ ${{github.event.pull_request.head.repo.full_name}} == nf-core/tools ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]

# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
Hi @${{ github.event.pull_request.user.login }},

It looks like this pull-request is has been made against the ${{github.event.pull_request.head.repo.full_name}} `master` branch.
The `master` branch on nf-core repositories should always contain code from the latest release.
Beacuse of this, PRs to `master` are only allowed if they come from the ${{github.event.pull_request.head.repo.full_name}} `dev` branch.

You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page.

Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
8 changes: 7 additions & 1 deletion .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow

- name: Run nf-core tools
- name: Run nf-core/tools
run: |
nf-core create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface"
nf-core lint nf-core-testpipeline
nf-core list
nf-core licences nf-core-testpipeline
nf-core sync nf-core-testpipeline/
nf-core schema build nf-core-testpipeline/ --no-prompts
nf-core bump-version nf-core-testpipeline/ 1.1
nf-core modules install nf-core-testpipeline/ fastqc
23 changes: 11 additions & 12 deletions .github/workflows/code-tests.yml → .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: Python tests
# This workflow is triggered on pushes and PRs to the repository.
on: [push, pull_request]
# Only run if we changed a Python file
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'

jobs:
PythonLint:
pytest:

runs-on: ubuntu-latest
strategy:
Expand All @@ -21,8 +28,8 @@ jobs:

- name: Install python dependencies
run: |
python -m pip install --upgrade pip pytest pytest-datafiles pytest-cov mock jsonschema
pip install .
python -m pip install --upgrade pip -r requirements-dev.txt
pip install -e .

- name: Install Nextflow
run: |
Expand All @@ -31,14 +38,6 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow

- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: python3 -m pytest --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint Python
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'

jobs:
PythonLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Check code lints with Black
uses: jpetrucciani/black-check@master
9 changes: 7 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8

- name: Install python dependencies
run: |
Expand All @@ -29,6 +29,11 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow

- name: Configure git
run: |
git config user.email "[email protected]"
git config user.name "nf-core-bot"

- name: Run synchronisation
if: github.repository == 'nf-core/tools'
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tools-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches: [master, dev]

jobs:
build-n-publish:
name: Build and publish nf-core to PyPI
api-docs:
name: Build & push Sphinx API docs
runs-on: ubuntu-18.04

steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
testing*
htmlcov/
.tox/
.coverage
Expand Down Expand Up @@ -107,3 +108,4 @@ ENV/

# backup files
*~
*\?
Loading