Skip to content

Commit 882302f

Browse files
committed
docs: tighten ConfigScope additions
Trim the nested-scope content to better match the verbosity of neighbouring sections: - Drop the second `@ConfigOption` field from `ReportConfig`; one field is enough to demonstrate the pattern - Drop the `types=` admonition; that rule is general `@ConfigOption` guidance rather than something specific to nested scopes, and the language server already surfaces it - Tighten the inheritance note from four sentences to two Signed-off-by: Jonathan Manning <jonathan.manning@seqera.io>
1 parent b0cfeb3 commit 882302f

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

docs/plugins/developing-plugins.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,25 +290,14 @@ class ReportConfig implements ConfigScope {
290290
''')
291291
final Path file
292292
293-
@ConfigOption
294-
@Description('''
295-
Whether report generation is enabled.
296-
''')
297-
final Boolean enabled
298-
299293
ReportConfig(Map opts) {
300294
this.file = opts.file as Path
301-
this.enabled = opts.enabled as Boolean ?: true
302295
}
303296
}
304297
```
305298

306299
:::{note}
307-
`@ConfigOption` fields are discovered with `Class.getDeclaredFields()`, which does not include fields inherited from a parent class. Each `ConfigScope` class must therefore declare its options directly. A shared parent class can still provide common logic, such as helper methods that compute default values, but the `@ConfigOption` declarations themselves must live on the concrete scope class.
308-
:::
309-
310-
:::{note}
311-
The `types` attribute on `@ConfigOption` is for declaring that an option accepts more than one type, and should only list [standard Nextflow types](https://docs.seqera.io/nextflow/reference/stdlib-types) (for example, `types=[String, List]`). Avoid using runtime classes such as `GString`, `Number` or `Map` here - they may produce confusing errors in the language server and do not correspond to configurable types.
300+
`@ConfigOption` fields are discovered with `Class.getDeclaredFields()`, which does not include inherited fields. Each `ConfigScope` class must declare its options directly, even if a shared parent class provides common logic.
312301
:::
313302

314303
This approach is not required to support plugin config options. However, it allows Nextflow to recognize plugin definitions when validating the configuration. See {ref}`config-scopes-page` for more information.

0 commit comments

Comments
 (0)