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

dev -> master for 2.12 #2698

Merged
merged 337 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
337 commits
Select commit Hold shift + click to select a range
2f4ad6d
don't pin subversion
mashehu Jan 5, 2024
2aab15d
Merge branch 'update-python-in-docker' of github.com:mashehu/tools in…
mashehu Jan 5, 2024
f0d1543
add more verbose fix-linting bot
mashehu Jan 5, 2024
ce26f64
introduce linting error
mashehu Jan 5, 2024
444aa84
Revert "introduce linting error"
mashehu Jan 5, 2024
0a4ff2f
Merge branch 'dev' into update-python-in-docker
mashehu Jan 5, 2024
e54d268
use pdiff also on gitpod for nf-test
mashehu Jan 8, 2024
0121539
[automated] Update CHANGELOG.md
nf-core-bot Jan 8, 2024
da9b55a
avoid artifact upload name collisions
mashehu Jan 8, 2024
4574b10
don't run CI on automated changelog changes
mashehu Jan 8, 2024
d23e491
[automated] Update CHANGELOG.md
nf-core-bot Jan 8, 2024
00a5fd1
fix one more collision
mashehu Jan 8, 2024
b1d7f3d
Merge branch 'smaller-ci-fixes' of github.com:mashehu/tools into smal…
mashehu Jan 8, 2024
b41038e
fix-copy-paste mistake
mashehu Jan 8, 2024
e6af209
fix nf-test caching
mashehu Jan 8, 2024
a0c5061
Remove PR from changelog, because it is just some cleanup for #2550
mashehu Jan 8, 2024
fddd38f
don't clean up but do a manual check for nf-test
mashehu Jan 8, 2024
b3df098
debug manual caching step
mashehu Jan 8, 2024
7eac66f
more debugging
mashehu Jan 8, 2024
3c41404
skip caching step correctly
mashehu Jan 8, 2024
65178ee
remove section indicator in Changelog entry
mashehu Jan 8, 2024
f448a77
only add codecov comment when coverage changes
mashehu Jan 8, 2024
e0dabc9
Merge pull request #2641 from mashehu/smaller-ci-fixes
mashehu Jan 8, 2024
06c6e5f
Merge branch 'dev' into use-pdiff-in-gitpot
mashehu Jan 8, 2024
9b45d58
put changelog comment in correct section
mashehu Jan 8, 2024
41d3575
Merge branch 'dev' into update-python-in-docker
mashehu Jan 8, 2024
19d2c4a
Merge pull request #2640 from mashehu/use-pdiff-in-gitpot
mashehu Jan 8, 2024
97e9bd4
Merge pull request #2636 from mashehu/update-python-in-docker
mashehu Jan 8, 2024
e338b73
Merge branch 'dev' into make-fix-linting-more-verbose
mashehu Jan 8, 2024
2f3e38f
set pdiff is nf-test differ in docker image for gitpod
mashehu Jan 8, 2024
f54f1f0
[automated] Update CHANGELOG.md [no ci]
nf-core-bot Jan 8, 2024
22613c5
update changelog [no ci]
mashehu Jan 8, 2024
501b6f0
Merge pull request #2642 from mashehu/add-pdiff-to-docker-image
mashehu Jan 8, 2024
9fb5498
Apply suggestions from code review
MatthiasZepper Jan 8, 2024
40eb38d
Merge branch 'dev' into GithubAction-DownloadTest
MatthiasZepper Jan 8, 2024
e8e6372
Merge pull request #2618 from MatthiasZepper/GithubAction-DownloadTest
MatthiasZepper Jan 8, 2024
2fef530
Merge branch 'dev' into make-fix-linting-more-verbose
mashehu Jan 9, 2024
3fa0d0d
Merge branch 'dev' into add-conda-defaults
mashehu Jan 9, 2024
225ef23
Merge pull request #2637 from mashehu/make-fix-linting-more-verbose
mashehu Jan 9, 2024
38779e9
Merge branch 'dev' into add-conda-defaults
mirpedrol Jan 9, 2024
df48d77
update changelog
mashehu Jan 9, 2024
ccf1104
Merge pull request #2094 from mashehu/add-conda-defaults
mashehu Jan 9, 2024
eb895dc
Template: switch to new image syntax in readme
mashehu Jan 9, 2024
ce4cf36
add a bit more logging to changelog script
mashehu Jan 9, 2024
6693377
more debugging
mashehu Jan 9, 2024
ffe1dd6
fix section selection
mashehu Jan 9, 2024
792f2a2
more debugging
mashehu Jan 9, 2024
ef18ea4
debugging
mashehu Jan 9, 2024
a82d9cc
debugging
mashehu Jan 9, 2024
197617f
fix section headers
mashehu Jan 9, 2024
403a6aa
[automated] Update CHANGELOG.md [no ci]
nf-core-bot Jan 9, 2024
243084b
Merge branch 'dev' into update-image-syntax-in-template
mashehu Jan 9, 2024
da485a8
Merge pull request #2645 from mashehu/update-image-syntax-in-template
mashehu Jan 9, 2024
f2f91e7
wrap picture element in h1 tag [no changelog]
mashehu Jan 9, 2024
06dc2f5
fix alt text
mashehu Jan 9, 2024
c9559e4
fix indentation
mashehu Jan 9, 2024
ba2bbf5
Merge pull request #2647 from mashehu/wrap-logo
mashehu Jan 9, 2024
863f74b
ci(renovate): Set renovate docker registry to docker.io
edmundmiller Jan 9, 2024
ba6b7ac
ci(renovate): Add python pep440 versioning
edmundmiller Jan 9, 2024
14f594c
ci(renovate): Ignore modules in pipeline template
edmundmiller Jan 9, 2024
9cfea63
chore: Update Changelog
edmundmiller Jan 9, 2024
a54686b
Merge pull request #2648 from nf-core/renovate-docker
edmundmiller Jan 9, 2024
dcbced8
fix ignorepath
mashehu Jan 10, 2024
28de3d6
[automated] Update CHANGELOG.md [no ci]
nf-core-bot Jan 10, 2024
891746d
avoid stopping all CI tests with changelog action
mashehu Jan 10, 2024
0c79f65
Merge branch 'fix-renovate' of github.com:mashehu/tools into fix-reno…
mashehu Jan 10, 2024
7538d7e
update changelog
mashehu Jan 10, 2024
6f85c0a
Merge pull request #2651 from mashehu/fix-renovate
mashehu Jan 10, 2024
cf73506
more renovate fixes [no changelog]
mashehu Jan 10, 2024
a7e1533
[automated] Update CHANGELOG.md
nf-core-bot Jan 10, 2024
02fe413
Update CHANGELOG.md
mashehu Jan 10, 2024
ed15dd3
Merge pull request #2652 from mashehu/fix-renovate
mashehu Jan 10, 2024
8320f80
Add Trogon
ewels Jan 11, 2024
41a6164
Fix ruff linting
ewels Jan 11, 2024
81a8c08
Update pre-commit hook astral-sh/ruff-pre-commit to v0.1.12
renovate[bot] Jan 12, 2024
900ce78
[automated] Update CHANGELOG.md
nf-core-bot Jan 12, 2024
8b760dd
Update CHANGELOG.md
mashehu Jan 12, 2024
39a52d5
Merge pull request #2657 from nf-core/renovate/astral-sh-ruff-pre-com…
mashehu Jan 12, 2024
a31fa1f
add to changelog
ewels Jan 12, 2024
a616de2
Add to the readme
ewels Jan 12, 2024
669be1e
Merge pull request #2655 from ewels/trogon
ewels Jan 12, 2024
56e7734
Update pre-commit hook astral-sh/ruff-pre-commit to v0.1.13
renovate[bot] Jan 12, 2024
91ae4fc
[automated] Update CHANGELOG.md
nf-core-bot Jan 12, 2024
110d99f
Merge pull request #2660 from nf-core/renovate/astral-sh-ruff-pre-com…
mashehu Jan 12, 2024
c962890
first version of nf-core logo command
mashehu Jan 16, 2024
f934535
first running version of logo creation function
mashehu Jan 16, 2024
2ad8824
remove debugging
mashehu Jan 16, 2024
e72fdfb
add type hints
mashehu Jan 16, 2024
911d46d
[automated] Update CHANGELOG.md
nf-core-bot Jan 16, 2024
9233dea
don't use removeprefix (requires python 3.9)
mashehu Jan 16, 2024
6a0ad74
Merge branch 'add-logo-creation' of github.com:mashehu/tools into add…
mashehu Jan 16, 2024
d441ef9
fix path to font file
mashehu Jan 16, 2024
2d6446b
fix path for assets
mashehu Jan 16, 2024
47f371a
bundle assets file
mashehu Jan 16, 2024
16a2b91
full path it is
mashehu Jan 16, 2024
bf9e93f
move manifest and use pkg_resources
mashehu Jan 16, 2024
7f1440b
switch to only generating png logos
mashehu Jan 17, 2024
ac79a37
fix command parameters
mashehu Jan 17, 2024
32f6da1
fix manifest file
mashehu Jan 17, 2024
6773a4c
address assets differently
mashehu Jan 17, 2024
76f39c7
add debugging
mashehu Jan 17, 2024
75d8ada
Fix tyop in pipeline template nextflow.config
drpatelh Jan 17, 2024
85bab14
[automated] Update CHANGELOG.md
nf-core-bot Jan 17, 2024
6d3677c
address the assets in a simpler way
mashehu Jan 17, 2024
6a0173b
Merge pull request #2664 from nf-core/config_tyop
mashehu Jan 17, 2024
ec5dcb4
cleanup assets folder
mashehu Jan 17, 2024
745396f
add debugging
mashehu Jan 17, 2024
0ce2091
fix path in manifest file
mashehu Jan 17, 2024
cc33ad9
fix jinja template for download_pipeline.yml action
mashehu Jan 17, 2024
244968b
debugging
mashehu Jan 17, 2024
c7e427f
add all files manually to manifest
mashehu Jan 17, 2024
4df7e2f
fix file name
mashehu Jan 17, 2024
352419a
fix logo output name
mashehu Jan 17, 2024
116e4de
fix tests
mashehu Jan 17, 2024
c290a98
run more verbosely
mashehu Jan 17, 2024
1edf9c9
more debugging comments
mashehu Jan 17, 2024
a0bde8c
fix logo file name
mashehu Jan 17, 2024
4364f57
allow some size fluctuation
mashehu Jan 17, 2024
cae7afa
use correct size factors
mashehu Jan 17, 2024
56e9758
increase test coverage
mashehu Jan 17, 2024
1007b6e
fix cli test
mashehu Jan 17, 2024
73099b8
wrap in raw comments to avoid jinja interference
mashehu Jan 17, 2024
fc741e2
include comments from code review
mashehu Jan 17, 2024
79adfa1
Update nf_core/__main__.py
mashehu Jan 17, 2024
2e44b48
Update tests/test_cli.py
mashehu Jan 17, 2024
f604f7d
add file name option
mashehu Jan 17, 2024
55330c4
Merge branch 'add-logo-creation' of github.com:mashehu/tools into add…
mashehu Jan 17, 2024
708994e
use correct name for logo creation
mashehu Jan 17, 2024
acf42d2
fix cli test
mashehu Jan 17, 2024
155cb3c
add filename test
mashehu Jan 17, 2024
4cc890a
add prefix to default name
mashehu Jan 17, 2024
64d5ab0
Update actions/cache action to v4
renovate[bot] Jan 17, 2024
a48fd4e
[automated] Update CHANGELOG.md
nf-core-bot Jan 17, 2024
c453edf
Merge pull request #2666 from nf-core/renovate/actions-cache-4.x
mashehu Jan 17, 2024
1a2ba92
Remove redundanct v in pipeline version for emails
drpatelh Jan 18, 2024
70985fb
Merge branch 'dev' into add-logo-creation
mashehu Jan 18, 2024
93db4e3
[automated] Update CHANGELOG.md
nf-core-bot Jan 18, 2024
577ac00
fix empty json output for modules list local
mashehu Jan 18, 2024
15fb980
[automated] Update CHANGELOG.md
nf-core-bot Jan 18, 2024
4e8a99c
add tests for json output
mashehu Jan 18, 2024
a791d45
add tests for keyword filtering
mashehu Jan 18, 2024
e1d2838
use the module 'org' directory for linting
mirpedrol Jan 18, 2024
b58fe9e
[automated] Update CHANGELOG.md
nf-core-bot Jan 18, 2024
3912bba
add tests for unknown keywords and wrong repo location
mashehu Jan 18, 2024
7b259a8
Merge pull request #2669 from mirpedrol/lint-patched-module
mirpedrol Jan 18, 2024
b76335a
Merge branch 'dev' into fix-modules-list-json
mashehu Jan 18, 2024
a4c18e2
Apply suggestions from code review
mashehu Jan 18, 2024
259b5be
add svg output option
mashehu Jan 18, 2024
c843e88
oops, forgot some files
mashehu Jan 18, 2024
1fe7f05
Update test_cli.py
mashehu Jan 18, 2024
7d9e37e
Merge pull request #2662 from mashehu/add-logo-creation
mashehu Jan 18, 2024
31c61ca
Merge pull request #2667 from nf-core/email_versions
drpatelh Jan 18, 2024
ee60968
handle redirects more gracefully when polling the nf-core website
mashehu Jan 19, 2024
4a8f1d6
[automated] Update CHANGELOG.md
nf-core-bot Jan 19, 2024
0b839f9
Merge branch 'dev' into handle-api-redirects
mashehu Jan 19, 2024
4b1b7ac
Update pre-commit hook astral-sh/ruff-pre-commit to v0.1.14
renovate[bot] Jan 19, 2024
dfaee04
[automated] Update CHANGELOG.md
nf-core-bot Jan 19, 2024
891051f
Delete nf_core/pipeline-template/lib/nfcore_external_java_deps.jar
drpatelh Jan 20, 2024
49dc7d9
Remove invalid reference in pyproject.toml
drpatelh Jan 20, 2024
5e6a0a9
remove lib/nfcore_external_java_deps.jar from list of necessary files
mashehu Jan 22, 2024
cb1e6fd
only fail if file if nf-validation plugin is in nextflow config
mashehu Jan 22, 2024
01aa95b
add linting of environment.yml name lowercase
mirpedrol Jan 22, 2024
aae4801
[automated] Update CHANGELOG.md
nf-core-bot Jan 22, 2024
faf8529
linting a pipeline also lints the installing subworkflows
mirpedrol Jan 22, 2024
b2a4ca3
warn instead of fail when no components are installed from the repo
mirpedrol Jan 22, 2024
ccdb2ef
update changelog
mirpedrol Jan 22, 2024
2e9d57c
add option to ignore files_unchanged based on nextflow.config
mashehu Jan 22, 2024
93f6af8
update modules in template
mashehu Jan 22, 2024
581dc45
add function to check -profile is well formatted
mirpedrol Jan 22, 2024
98522ca
[automated] Update CHANGELOG.md
nf-core-bot Jan 22, 2024
b0eb8d2
Merge pull request #2676 from mirpedrol/lint-environment
mirpedrol Jan 24, 2024
b9740ac
Merge branch 'dev' into lint-pipeline-swf
mirpedrol Jan 24, 2024
fc27e38
Apply suggestions from code review
mirpedrol Jan 24, 2024
af40445
keep error when no subworkflows installed but allow it when linting a…
mirpedrol Jan 24, 2024
c9a4839
fix pipeline linting test
mirpedrol Jan 24, 2024
ee25312
Merge pull request #2677 from mirpedrol/lint-pipeline-swf
mirpedrol Jan 24, 2024
27f501a
Merge pull request #2678 from mirpedrol/profile-comma
mirpedrol Jan 24, 2024
954a033
Merge branch 'dev' into fix-modules-list-json
mashehu Jan 24, 2024
011f3ac
Merge pull request #2668 from mashehu/fix-modules-list-json
mashehu Jan 24, 2024
6b5ee8c
lint nextflow.config default values match the specified in nextflow_s…
mirpedrol Jan 25, 2024
6393e00
Update peter-evans/create-or-update-comment action to v4
renovate[bot] Jan 25, 2024
8f0ecbd
[automated] Update CHANGELOG.md
nf-core-bot Jan 25, 2024
e811b12
Merge branch 'dev' of github.com:nf-core/tools into rm_nfcore_externa…
mashehu Jan 25, 2024
0023c74
add tests for linting default values
mirpedrol Jan 25, 2024
ee6fe87
[automated] Update CHANGELOG.md
nf-core-bot Jan 25, 2024
57bc258
Apply suggestions from code review
mirpedrol Jan 25, 2024
d47ba22
allow ignoring specific files when linting template_strings
mirpedrol Jan 25, 2024
4b114c9
fix type error, switch to pathlib
mashehu Jan 25, 2024
a278b61
add tests for linting template_strings (not passing)
mirpedrol Jan 25, 2024
a67deb1
[automated] Update CHANGELOG.md
nf-core-bot Jan 25, 2024
c11055b
Merge pull request #2672 from mashehu/handle-api-redirects
mashehu Jan 26, 2024
83003fc
Add error message to template with link to docs on 'resource availabl…
jfy133 Jan 26, 2024
cc5173f
Update CHANGELOG.md
jfy133 Jan 26, 2024
455b0fd
Merge branch 'dev' into dev
jfy133 Jan 26, 2024
4d85614
Linting
jfy133 Jan 26, 2024
4676092
convert to pathlib and fix tests
mashehu Jan 26, 2024
71b17d5
fix template_strings tests
mirpedrol Jan 26, 2024
e3c2dec
run whole test strategy for template tests even if one fails
mashehu Jan 26, 2024
b160446
fix bug when linting subworkflows from pipeline lint
mirpedrol Jan 26, 2024
c0d5bdd
convert pathlibs to strings for comparison
mashehu Jan 26, 2024
4e23325
add docs for merge_markers
mirpedrol Jan 26, 2024
2d7db38
Merge branch 'merge_markers' into lint-ignore-files
mirpedrol Jan 26, 2024
855e22e
Update pipeline.nf
jfy133 Jan 26, 2024
bf43d52
debug fix-linting comment [no changelog]
mashehu Jan 26, 2024
996c54b
Merge pull request #2688 from jfy133/dev
jfy133 Jan 26, 2024
cc3aa5f
Merge branch 'dev' into rm_nfcore_external_java_deps
mashehu Jan 26, 2024
5e4147c
Merge pull request #2675 from nf-core/rm_nfcore_external_java_deps
mashehu Jan 26, 2024
acc1692
Merge pull request #2690 from mashehu/fix-linting-comment
mashehu Jan 26, 2024
c4c61c6
template: add 👀👍🏻🎉😕 reactions to fix-linting bot action
mashehu Jan 26, 2024
100d2e8
cache created logos and hand force over to create_logo
mashehu Jan 26, 2024
ea68d7d
[automated] Update CHANGELOG.md
nf-core-bot Jan 26, 2024
63b6a5a
add missing slash
mashehu Jan 26, 2024
14fdea5
Merge branch 'nicer-lint-bot-comment' of github.com:mashehu/tools int…
mashehu Jan 26, 2024
5a25489
fix tests failing due to Path
mirpedrol Jan 26, 2024
86ffafe
Merge pull request #2684 from mirpedrol/lint-config-schema
mirpedrol Jan 26, 2024
030415e
Apply suggestions from code review
mirpedrol Jan 26, 2024
6f52fac
Merge branch 'dev' into nicer-lint-bot-comment
mashehu Jan 26, 2024
5a2ce1b
Merge pull request #2692 from mashehu/nicer-lint-bot-comment
mashehu Jan 26, 2024
3fe5bf2
Revert "template: add 👀👍🏻🎉😕 reactions to fix-linting bot action"
mashehu Jan 26, 2024
2027521
Merge pull request #2693 from nf-core/revert-2692-nicer-lint-bot-comment
mashehu Jan 26, 2024
263b2e0
Merge branch 'dev' into lint-ignore-files
mirpedrol Jan 26, 2024
1b3f7e7
fix linting
mashehu Jan 26, 2024
6b3f689
Merge branch 'dev' of github.com:nf-core/tools into nicer-lint-bot-co…
mashehu Jan 26, 2024
dbb5800
reapply changes to fix-linting action
mashehu Jan 26, 2024
08ff303
Revert "Revert "template: add 👀👍🏻🎉😕 reactions to fix-linting bot acti…
mashehu Jan 26, 2024
a45e605
[automated] Update CHANGELOG.md
nf-core-bot Jan 26, 2024
a45dc71
fix linting
mashehu Jan 26, 2024
91f1d3c
Update CHANGELOG.md
mashehu Jan 26, 2024
eef51f3
Merge branch 'nicer-lint-bot-comment-again' of github.com:mashehu/too…
mashehu Jan 26, 2024
b956079
Merge pull request #2694 from mashehu/nicer-lint-bot-comment-again
mashehu Jan 26, 2024
6805ee1
Merge pull request #2689 from mirpedrol/subworkflow-lint
mirpedrol Jan 29, 2024
0a43d19
Merge branch 'dev' into renovate/astral-sh-ruff-pre-commit-0.x
mirpedrol Jan 29, 2024
b6eb508
Merge pull request #2674 from nf-core/renovate/astral-sh-ruff-pre-com…
mirpedrol Jan 29, 2024
027c519
Merge branch 'dev' into renovate/peter-evans-create-or-update-comment…
mirpedrol Jan 29, 2024
93b96d0
Merge pull request #2686 from mirpedrol/lint-ignore-files
mirpedrol Jan 29, 2024
e383527
Merge pull request #2683 from nf-core/renovate/peter-evans-create-or-…
mirpedrol Jan 29, 2024
40aac13
Update peter-evans/create-or-update-comment action to v4
renovate[bot] Jan 29, 2024
e362e29
[automated] Update CHANGELOG.md
nf-core-bot Jan 29, 2024
95f449d
bump to 2.12 for release
mirpedrol Jan 29, 2024
eb2531f
Merge pull request #2695 from nf-core/renovate/peter-evans-create-or-…
mashehu Jan 29, 2024
df89d53
use correct prettier version in pre-commit template [no changelog]
mashehu Jan 29, 2024
deedfa3
Merge pull request #2697 from mashehu/fix-pre-prettier
mashehu Jan 29, 2024
ff5ef8d
add documentation for create-logo command
mashehu Jan 29, 2024
9fe9d5a
Merge pull request #2699 from mashehu/add-create-logo-to-readme
mashehu Jan 29, 2024
8a7502a
Merge pull request #2696 from mirpedrol/bump-2.12
mirpedrol Jan 29, 2024
9e783fe
fix template name for logo
mashehu Jan 29, 2024
55088b5
no need for prefix variable, because it is hard-coded in the template
mashehu Jan 29, 2024
6bde19b
add option to switch runner
mashehu Jan 29, 2024
3588841
Merge pull request #2700 from mashehu/fix-logo-links
mashehu Jan 29, 2024
d177bd6
Generate new screengrabs with rich-codex
github-actions[bot] Jan 29, 2024
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
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ indent_style = space

[*.{md,yml,yaml,html,css,scss,js,cff}]
indent_size = 2

# ignore python and markdown files
[*.py]
indent_style = unset

[**/{CONTRIBUTING,README}.md]
indent_style = unset

[**/Makefile]
indent_style = unset
5 changes: 4 additions & 1 deletion .github/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[run]
omit = nf_core/pipeline-template/*
omit = nf_core/*-template/*
source = nf_core
relative_files = True

33 changes: 8 additions & 25 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,28 @@ pip install -e .

## Code formatting

### Black
### Ruff

All Python code in nf-core/tools must be passed through the [Black Python code formatter](https://black.readthedocs.io/en/stable/).
All Python code in nf-core/tools must be passed through the [Ruff code linter and formatter](https://github.com/astral-sh/ruff).
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:
You can run Ruff on the command line (it's included in `requirements-dev.txt`) - eg. to run recursively on the whole repository:

```bash
black .
ruff format .
```

Alternatively, Black has [integrations for most common editors](https://black.readthedocs.io/en/stable/editor_integration.html)
Alternatively, Ruff has [integrations for most common editors](https://github.com/astral-sh/ruff-lsp) and VSCode(https://github.com/astral-sh/ruff-vscode)
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.
any code does not adhere to Ruff formatting.

### isort

All Python code must also be passed through [isort](https://pycqa.github.io/isort/index.html).
This ensures a harmonised imports throughout the package, from all contributors.

To run isort on the command line recursively on the whole repository you can use:

```bash
isort .
```

isort also has [plugins for most common editors](https://github.com/pycqa/isort/wiki/isort-Plugins)
to automatically format code when you hit save.
Or [version control integration](https://pycqa.github.io/isort/docs/configuration/pre-commit.html) to set it up to run when you make a commit.

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 isort formatting.
Ruff has been adopted for linting and formatting in replacement of Black, isort (for imports) and pyupgrade. It also includes Flake8.

### pre-commit hooks

This repository comes with [pre-commit](https://pre-commit.com/) hooks for black, isort and Prettier. pre-commit automatically runs checks before a commit is committed into the git history. If all checks pass, the commit is made, if files are changed by the pre-commit hooks, the user is informed and has to stage the changes and attempt the commit again.
This repository comes with [pre-commit](https://pre-commit.com/) hooks for ruff and Prettier. pre-commit automatically runs checks before a commit is committed into the git history. If all checks pass, the commit is made, if files are changed by the pre-commit hooks, the user is informed and has to stage the changes and attempt the commit again.

You can use the pre-commit hooks if you like, but you don't have to. The CI on Github will run the same checks as the tools installed with pre-commit. If the pre-commit checks pass, then the same checks in the CI will pass, too.

Expand Down
12 changes: 12 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["github>nf-core/ops//.github/renovate/default.json5"],
ignorePaths: ["**/nf_core/pipeline-template/modules/nf-core/**"],
baseBranches: ["dev"],
packageRules: [
{
matchDatasources: ["docker"],
matchPackageNames: ["python"],
versioning: "pep440",
},
{
matchDatasources: ["docker"],
registryUrls: ["docker.io"],
},
],
}
2 changes: 1 addition & 1 deletion .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# 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
uses: mshick/add-pr-comment@v2
with:
message: |
## This PR is against the `master` branch :x:
Expand Down
228 changes: 228 additions & 0 deletions .github/workflows/changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
"""
Taken from https://github.com/MultiQC/MultiQC/blob/main/.github/workflows/changelog.py and updated for nf-core

To be called by a CI action. Assumes the following environment variables are set:
PR_TITLE, PR_NUMBER, GITHUB_WORKSPACE.

Adds a line into the CHANGELOG.md:
* Looks for the section to add the line to, based on the PR title, e.g. `Template:`, `Modules:`.
* All other change will go under the "### General" section.
* If an entry for the PR is already added, it will not run.

Other assumptions:
- CHANGELOG.md has a running section for an ongoing "dev" version
(i.e. titled "## nf-core vX.Ydev").
"""

import os
import re
import sys
from pathlib import Path
from typing import List

REPO_URL = "https://github.com/nf-core/tools"

# Assumes the environment is set by the GitHub action.
pr_title = os.environ["PR_TITLE"]
pr_number = os.environ["PR_NUMBER"]
comment = os.environ.get("COMMENT", "")
workspace_path = Path(os.environ.get("GITHUB_WORKSPACE", ""))

assert pr_title, pr_title
assert pr_number, pr_number

# Trim the PR number added when GitHub squashes commits, e.g. "Template: Updated (#2026)"
pr_title = pr_title.removesuffix(f" (#{pr_number})")

changelog_path = workspace_path / "CHANGELOG.md"

if any(
line in pr_title.lower()
for line in [
"skip changelog",
"skip change log",
"no changelog",
"no change log",
"bump version",
]
):
print("Skipping changelog update")
sys.exit(0)


def _determine_change_type(pr_title) -> tuple[str, str]:
"""
Determine the type of the PR: Template, Download, Linting, Modules, Subworkflows, or General
Returns a tuple of the section name and the module info.
"""
sections = {
"Template": "### Template",
"Download": "### Download",
"Linting": "### Linting",
"Modules": "### Modules",
"Subworkflows": "### Subworkflows",
}
current_section_header = "### General"
current_section = "General"

# Check if the PR in any of the sections.
for section, section_header in sections.items():
# check if the PR title contains any of the section headers, with some loose matching, e.g. removing plural and suffixes
if re.sub(r"s$", "", section.lower().replace("ing", "")) in pr_title.lower():
current_section_header = section_header
current_section = section
print(f"Detected section: {current_section}")
return current_section, current_section_header


# Determine the type of the PR
section, section_header = _determine_change_type(pr_title)

# Remove section indicator from the PR title.
pr_title = re.sub(rf"{section}[:\s]*", "", pr_title, flags=re.IGNORECASE)

# Prepare the change log entry.
pr_link = f"([#{pr_number}]({REPO_URL}/pull/{pr_number}))"

# Handle manual changelog entries through comments.
if comment := comment.removeprefix("@nf-core-bot changelog").strip():
print(f"Adding manual changelog entry: {comment}")
pr_title = comment
new_lines = [
f"- {pr_title} {pr_link}\n",
]

print(f"Adding new lines into section '{section}':\n" + "".join(new_lines))

# Finally, updating the changelog.
# Read the current changelog lines. We will print them back as is, except for one new
# entry, corresponding to this new PR.
with changelog_path.open("r") as f:
orig_lines = f.readlines()
updated_lines: List[str] = []


def _skip_existing_entry_for_this_pr(line: str, same_section: bool = True) -> str:
if line.strip().endswith(pr_link):
print(f"Found existing entry for this pull request #{pr_number}:")
existing_lines = [line]
if new_lines and new_lines == existing_lines and same_section:
print(f"Found existing identical entry for this pull request #{pr_number} in the same section:")
print("".join(existing_lines))
sys.exit(0) # Just leaving the CHANGELOG intact
else:
print(
f"Found existing entry for this pull request #{pr_number}. It will be replaced and/or moved to proper section"
)
print("".join(existing_lines))
for _ in range(len(existing_lines)):
try:
line = orig_lines.pop(0)
except IndexError:
break
return line


# Find the next line in the change log that matches the pattern "# nf-core/tools v.*dev"
# If it doesn't exist, exist with code 1 (let's assume that a new section is added
# manually or by CI when a release is pushed).
# Else, find the next line that matches the `section` variable, and insert a new line
# under it (we also assume that section headers are added already).
inside_version_dev = False
already_added_entry = False
while orig_lines:
line = orig_lines.pop(0)

# If the line already contains a link to the PR, don't add it again.
line = _skip_existing_entry_for_this_pr(line, same_section=False)

if line.startswith("# ") and not line.strip() == "# nf-core/tools: Changelog": # Version header, e.g. "# v2.12dev"
print(f"Found version header: {line.strip()}")
updated_lines.append(line)

# Parse version from the line `# v2.12dev` or
# `# [v2.11.1 - Magnesium Dragon Patch](https://github.com/nf-core/tools/releases/tag/2.11) - [2023-12-20]` ...
if not (m := re.match(r".*(v\d+\.\d+(dev)?).*", line)):
print(f"Cannot parse version from line {line.strip()}.", file=sys.stderr)
sys.exit(1)
version = m.group(1)

if not inside_version_dev:
if not version.endswith("dev"):
print(
"Can't find a 'dev' version section in the changelog. Make sure "
"it's created, and all the required sections, e.g. `### Template` are created under it .",
file=sys.stderr,
)
sys.exit(1)
inside_version_dev = True
else:
if version.endswith("dev"):
print(
f"Found another 'dev' version section in the changelog, make"
f"sure to change it to a 'release' stable version tag. "
f"Line: {line.strip()}",
file=sys.stderr,
)
sys.exit(1)
# We are past the dev version, so just add back the rest of the lines and break.
while orig_lines:
line = orig_lines.pop(0)
line = _skip_existing_entry_for_this_pr(line, same_section=False)
if line:
updated_lines.append(line)
break
continue
print(f"Found line: {line.strip()}")
print(f"inside_version_dev: {inside_version_dev}")
print(f"section_header: {section_header}")
if inside_version_dev and line.lower().startswith(section_header.lower()): # Section of interest header
print(f"Found section header: {line.strip()}")
if already_added_entry:
print(
f"Already added new lines into section {section}, is the section duplicated?",
file=sys.stderr,
)
sys.exit(1)
updated_lines.append(line)
# Collecting lines until the next section.
section_lines: List[str] = []
while True:
line = orig_lines.pop(0)
if line.startswith("#"):
print(f"Found the next section header: {line.strip()}")
# Found the next section header, so need to put all the lines we collected.
updated_lines.append("\n")
_updated_lines = [_l for _l in section_lines + new_lines if _l.strip()]
updated_lines.extend(_updated_lines)
updated_lines.append("\n")
if new_lines:
print(f"Updated {changelog_path} section '{section}' with lines:\n" + "".join(new_lines))
else:
print(f"Removed existing entry from {changelog_path} section '{section}'")
already_added_entry = True
# Pushing back the next section header line
orig_lines.insert(0, line)
break
# If the line already contains a link to the PR, don't add it again.
line = _skip_existing_entry_for_this_pr(line, same_section=True)
section_lines.append(line)
else:
updated_lines.append(line)


def collapse_newlines(lines: List[str]) -> List[str]:
updated = []
for idx in range(len(lines)):
if idx != 0 and not lines[idx].strip() and not lines[idx - 1].strip():
continue
updated.append(lines[idx])
return updated


updated_lines = collapse_newlines(updated_lines)


# Finally, writing the updated lines back.
with changelog_path.open("w") as f:
f.writelines(updated_lines)
Loading