You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,31 @@
1
1
# nextflow-io/nf-schema: Changelog
2
2
3
+
# Version 2.4.0
4
+
5
+
## New features
6
+
7
+
1. Added a new configuration option: `validation.maxErrValSize` which sets the maximum length that a value in an error message can be. The default is set to 150 characters.
8
+
2. Added a new function: `validate()` that can be used to validate any data structure using a JSON schema.
9
+
10
+
## Bug fixes
11
+
12
+
1. Move the unpinned version check to an observer. This makes sure the warning is always shown and not only when importing a function.
13
+
2. Added a missing inherited method to the observer to fix issues with workflow output publishing
14
+
3. Fixed unexpected failures with samplesheet schemas using `anyOf`, `allOf` and `oneOf`
15
+
4. Fixed an error with help messages when the `type` keyword was missing
16
+
5. Fix compilation errors in Java 21
17
+
18
+
## Improvements
19
+
20
+
1. Slow uniqueness check (> 2hrs for 100k samples) made 400x faster by switching from `findAll` to a `subMap` for isolating the required unique fields.
21
+
2.`patternProperties` now has greater support, with no warnings about invalid parameters which actually match a pattern
22
+
3. Added better error handling and debug messages to the configuration parser.
23
+
24
+
## Changes
25
+
26
+
1. Refactored the whole codebase to make future development easier
27
+
2. Bumped the minimal Nextflow version to `24.10.0`
Configure the maximum characters of a value that may be shown in an error message. It takes a whole number above or equal to `1`. A value will be truncated when it goes over the maximum amount of characters.
101
+
102
+
Setting this option to `-1` will allow any amount of characters for values.
103
+
104
+
See the below example where the limit is to 20 characters:
105
+
106
+
```
107
+
* --test (abcdefghij...qrstuvwxyz): Value is [string] but should be [integer]
108
+
```
109
+
110
+
```groovy
111
+
validation.maxErrValSize = 100 // default: 150
112
+
```
113
+
98
114
## help
99
115
100
116
The `validation.help` config scope can be used to configure the creation of the help message.
Copy file name to clipboardExpand all lines: docs/contributing/setup.md
+21-31Lines changed: 21 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ description: How to contribute to nf-schema
5
5
6
6
# Getting started with plugin development
7
7
8
-
## Compiling
8
+
## Tests
9
9
10
-
To compile and run the tests use the following command:
10
+
To run the tests use the following command:
11
11
12
12
```bash
13
-
./gradlew check
13
+
make test
14
14
```
15
15
16
-
## Launch it with installed Nextflow
16
+
## Install and use in pipelines
17
17
18
18
!!! warning
19
19
@@ -39,33 +39,6 @@ plugins {
39
39
}
40
40
```
41
41
42
-
## Launch it with a local version of Nextflow
43
-
44
-
- Clone the Nextflow repo into a sibling directory
45
-
46
-
```bash
47
-
cd .. && git clone https://github.com/nextflow-io/nextflow
48
-
cd nextflow && ./gradlew exportClasspath
49
-
```
50
-
51
-
- Append to the `settings.gradle` in this project the following line:
52
-
53
-
```bash
54
-
includeBuild('../nextflow')
55
-
```
56
-
57
-
- Compile the plugin code
58
-
59
-
```bash
60
-
./gradlew compileGroovy
61
-
```
62
-
63
-
- Run nextflow with this command:
64
-
65
-
```bash
66
-
./launch.sh run -plugins nf-schema <script/pipeline name> [pipeline params]
67
-
```
68
-
69
42
## Change and preview the docs
70
43
71
44
The docs are generated using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
@@ -82,3 +55,20 @@ mkdocs serve
82
55
```
83
56
84
57
To preview the docs, open the URL provided by mkdocs in your browser.
58
+
59
+
## Release and publish the plugin
60
+
61
+
1. In `build.gradle` make sure that:
62
+
-`version` matches the desired release version,
63
+
-`github.repository` matches the repository of the plugin,
64
+
-`github.indexUrl` points to your fork of the plugins index repository.
65
+
2. Create a file named `$HOME/.gradle/gradle.properties`, where `$HOME` is your home directory. Add the following properties:
66
+
-`github_username`: The GitHub username granting access to the plugin repository.
67
+
-`github_access_token`: The GitHub access token required to upload and commit changes to the plugin repository.
68
+
-`github_commit_email`: The email address associated with your GitHub account.
69
+
3. Update the [changelog](./CHANGELOG.md).
70
+
4. Build and publish the plugin to your GitHub repository:
71
+
```bash
72
+
make release
73
+
```
74
+
5. Create a pull request against the [nextflow-io/plugins](https://github.com/nextflow-io/plugins/blob/main/plugins.json) repository to make the plugin publicly accessible.
description: Function to validate common data structures
4
+
---
5
+
6
+
# Validate common data structures
7
+
8
+
The `validate` function can be used to validate common data structures.
9
+
10
+
```groovy
11
+
include { validate } from 'plugin/nf-schema'
12
+
13
+
validate(<input>, <schema>)
14
+
```
15
+
16
+
This function takes two positional arguments:
17
+
18
+
1. The data that needs to be validated
19
+
2. The path to the schema used to validate the input data
20
+
21
+
The tested data structures are listed below, however more data structures might by supported too:
22
+
23
+
- Maps
24
+
- Lists
25
+
- String
26
+
- Integers
27
+
- Booleans
28
+
29
+
`validate` also has the following optional arguments:
30
+
31
+
-`exitOnError`: Exit the pipeline on validation failure and show the error message. The function will output the errors when this option is set to `false` (default: `true`)
0 commit comments