Lint Nextflow pipelines in Python
Project description
RefTrace
Lint Nextflow pipelines in Python.
pip install reftrace
Features
- Write custom linting rules in Python.
- Avoid parsing the Nextflow DSL.
- Access the Nextflow DSL from Python.
Example Rule
@rule
def no_labels(module: Module, results: LintResults):
for process in module.processes:
if not process.labels:
results.warnings.append(
ModuleWarning(
line=process.line,
warning=f"process '{process.name}' has no labels"
)
)
Getting Started
Run in your pipeline directory:
reftrace generate # Create rules.py starter rules
reftrace lint
You'll get output like this:
Module: /home/andrew/nf-core/rnaseq/modules/nf-core/preseq/lcextrap/main.nf
Warning on line 1: process 'PRESEQ_LCEXTRAP' has non-standard labels: ['error_ignore']
Module: /home/andrew/nf-core/rnaseq/modules/nf-core/hisat2/build/main.nf
Warning on line 1: process 'HISAT2_BUILD' has conflicting labels: ['process_high', 'process_high_memory']
RefTrace automatically runs the linting rules in rules.py on all modules in the pipeline.
Access Nextflow from Python
from reftrace import Module
module = Module("path/to/nextflow.nf")
Limitations
-
Not all parts of the Nextflow DSL are yet exposed. Specifically, only processes are handled. Only directives, process inputs, and process outputs are exposed to linting rules.
-
The parser is not perfect. It doesn't seek to handle all of Groovy, but enough to work in practice. Even so, test coverage could be better. If you encounter a parsing bug, please open an issue.
Test Data
The files in the testdata/groovy_core directory are derived from the Apache Groovy project's test suite and are licensed under the Apache License 2.0. The original source files can be found in the Apache Groovy repository.
Acknowledgements
We would like to express our gratitude to the following:
- The Apache Groovy project.
- The ANTLR project, for providing the parser generator used in this tool.
- The Go programming language and its standard library.
- The Nextflow project and community, for being so welcoming and helpful.
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6237b6584499bc6ef2daaf2daa6188538de80244326123cb79391c749d0cf156
|
|
| MD5 |
1bfc8356d77ba06a72361bb1545b803c
|
|
| BLAKE2b-256 |
baa833b26b25fce65ab94c178447d87c22b14be9ae0de150b94353b247044d31
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp313-cp313-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
6237b6584499bc6ef2daaf2daa6188538de80244326123cb79391c749d0cf156 - Sigstore transparency entry: 164938404
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff48b965b7ad7303e542b26ba8210905d7d1430479cc9e799960d8844d58360
|
|
| MD5 |
23b47888076ec5df3231dabafa3200a8
|
|
| BLAKE2b-256 |
f318dbb38c5930a6875447fea3c2cdbe2f8222c98d6cf98b58718d04185c26dd
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
8ff48b965b7ad7303e542b26ba8210905d7d1430479cc9e799960d8844d58360 - Sigstore transparency entry: 164938414
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d568c6a8662e7d0d7ec405e12d7d0b3f49d760c92b9f4586bb503003707c49bd
|
|
| MD5 |
d258a0a9919db122250eea13e07dc0a9
|
|
| BLAKE2b-256 |
5ea12c502bbf2584f6e8354c2cc6f29fab215f3a10d583708985308278f67961
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
d568c6a8662e7d0d7ec405e12d7d0b3f49d760c92b9f4586bb503003707c49bd - Sigstore transparency entry: 164938396
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a499271bd7eacb6f59be2640447f5aa2eac218c48ce53add2560f1d779fadb6
|
|
| MD5 |
5fee9ec0185d57522b1f778d00a83e6c
|
|
| BLAKE2b-256 |
6e8d3027a28241c8e8639b081f2554a2e45a20a03a79a383d616cfd83bd77459
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
2a499271bd7eacb6f59be2640447f5aa2eac218c48ce53add2560f1d779fadb6 - Sigstore transparency entry: 164938407
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd1aff40b8cce788f7e903d2dc321405e08dc33a1fd71dc52f1ee0d1e84da8f
|
|
| MD5 |
f5eb13984e9f1ffc8e13ceef142b6284
|
|
| BLAKE2b-256 |
e797567c5fa2c6ccbdef7b8e91350f15137e65ed21040f557aed4a191ac37f49
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
1bd1aff40b8cce788f7e903d2dc321405e08dc33a1fd71dc52f1ee0d1e84da8f - Sigstore transparency entry: 164938411
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1b628e9b344f8fc2b92f99f976d92032e6afc7f3039785cad4bdb02cb27163
|
|
| MD5 |
6dfc92fae87ee290c0f28a6d128cc868
|
|
| BLAKE2b-256 |
398dd16e12fee50528a4293fab59a3f43d9cfe7da4e21087e8574f34513c1ee2
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
6e1b628e9b344f8fc2b92f99f976d92032e6afc7f3039785cad4bdb02cb27163 - Sigstore transparency entry: 164938403
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64494c4a99d112e60f0bb7db82e1bd74730ec9d224b1688f6f5815b01a32ab08
|
|
| MD5 |
46f6e05d61110f3da7036b26452d0deb
|
|
| BLAKE2b-256 |
6e66e4a13f850a5a48ccdf21c5e11d52b2905aa975eff617f27c19d589113ff8
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
64494c4a99d112e60f0bb7db82e1bd74730ec9d224b1688f6f5815b01a32ab08 - Sigstore transparency entry: 164938400
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
281028e5ae1dfe66c3ac83d29371fa46ed1fcfa94a4de1774a089afb223c3619
|
|
| MD5 |
e76eb410db08433c9d892311f793aea3
|
|
| BLAKE2b-256 |
c69b753cd872412eba6587a19b25671c3efa12c47900259dd2a68e3156861fba
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl -
Subject digest:
281028e5ae1dfe66c3ac83d29371fa46ed1fcfa94a4de1774a089afb223c3619 - Sigstore transparency entry: 164938418
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a6aedc1e64d0bacea0c0cf55de3dfaf1260045ad33674c2a2ea6e1e441b1f62
|
|
| MD5 |
aea6fc902c6c9fd093f0d172501679e7
|
|
| BLAKE2b-256 |
291c163778f05d15cc94698174c47ac18707631c627ad613b41cc925d48bc4ea
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp39-cp39-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
9a6aedc1e64d0bacea0c0cf55de3dfaf1260045ad33674c2a2ea6e1e441b1f62 - Sigstore transparency entry: 164938386
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc0f7daed5a2395315a2972dfab4c46cc906bd1304d5144bf7df8d8fc01edd87
|
|
| MD5 |
5c0c66a21a1fb679e2c13aafcc2606a0
|
|
| BLAKE2b-256 |
2be22fe6de741e633f938b8838c767f39ad6ac84461e194668e252ede488fe4d
|
Provenance
The following attestation bundles were made for reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl:
Publisher:
build.yml on RefTrace/RefTrace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl -
Subject digest:
dc0f7daed5a2395315a2972dfab4c46cc906bd1304d5144bf7df8d8fc01edd87 - Sigstore transparency entry: 164938391
- Sigstore integration time:
-
Permalink:
RefTrace/RefTrace@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RefTrace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@2a2a6b5b3789c00d0ee58a0ca3239201785b5f18 -
Trigger Event:
workflow_dispatch
-
Statement type: