Skip to content

Commit 32f1735

Browse files
committed
Fix formatting of closures with no parameters
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent f6f3329 commit 32f1735

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1107
-1178
lines changed

modules/compiler/src/main/java/config/dsl/ConfigOption.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
@Retention(RetentionPolicy.RUNTIME)
2424
@Target({ ElementType.FIELD, ElementType.METHOD })
2525
public @interface ConfigOption {
26-
String value();
2726
}

modules/compiler/src/main/java/config/dsl/ConfigScope.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@
1818
import org.pf4j.ExtensionPoint;
1919

2020
public interface ConfigScope extends ExtensionPoint {
21-
String name();
22-
String description();
2321
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2013-2024, Seqera Labs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package nextflow.config.dsl;
17+
18+
import java.lang.annotation.ElementType;
19+
import java.lang.annotation.Retention;
20+
import java.lang.annotation.RetentionPolicy;
21+
import java.lang.annotation.Target;
22+
23+
@Retention(RetentionPolicy.RUNTIME)
24+
@Target({ ElementType.FIELD })
25+
public @interface PlaceholderName {
26+
String value();
27+
}

modules/compiler/src/main/java/config/scopes/ApptainerConfig.java

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,73 @@
1818
import groovy.transform.CompileStatic;
1919
import nextflow.config.dsl.ConfigOption;
2020
import nextflow.config.dsl.ConfigScope;
21+
import nextflow.script.dsl.Description;
2122
import nextflow.script.types.Duration;
2223

2324
public class ApptainerConfig implements ConfigScope {
2425

25-
public ApptainerConfig() {}
26-
27-
@Override
28-
public String name() {
29-
return "apptainer";
30-
}
31-
32-
@Override
33-
public String description() {
34-
return """
35-
The `apptainer` scope controls how [Apptainer](https://apptainer.org) containers are executed by Nextflow.
36-
37-
[Read more](https://nextflow.io/docs/latest/reference/config.html#apptainer)
38-
""";
39-
}
40-
41-
@ConfigOption("""
26+
@ConfigOption
27+
@Description("""
4228
When `true` Nextflow automatically mounts host paths in the executed container. It requires the `user bind control` feature to be enabled in your Apptainer installation (default: `true`).
4329
""")
4430
public boolean autoMounts;
4531

46-
@ConfigOption("""
32+
@ConfigOption
33+
@Description("""
4734
The directory where remote Apptainer images are stored. When using a computing cluster it must be a shared folder accessible to all compute nodes.
4835
""")
4936
public String cacheDir;
5037

51-
@ConfigOption("""
38+
@ConfigOption
39+
@Description("""
5240
Enable Apptainer execution (default: `false`).
5341
""")
5442
public boolean enabled;
5543

56-
@ConfigOption("""
44+
@ConfigOption
45+
@Description("""
5746
This attribute can be used to provide any option supported by the Apptainer engine i.e. `apptainer [OPTIONS]`.
5847
""")
5948
public String engineOptions;
6049

61-
@ConfigOption("""
50+
@ConfigOption
51+
@Description("""
6252
Comma separated list of environment variable names to be included in the container environment.
6353
""")
6454
public String envWhitelist;
6555

66-
@ConfigOption("""
56+
@ConfigOption
57+
@Description("""
6758
Directory where remote Apptainer images are retrieved. When using a computing cluster it must be a shared folder accessible to all compute nodes.
6859
""")
6960
public String libraryDir;
7061

71-
@ConfigOption("""
62+
@ConfigOption
63+
@Description("""
7264
Pull the Apptainer image with http protocol (default: `false`).
7365
""")
7466
public boolean noHttps;
7567

76-
@ConfigOption("""
68+
@ConfigOption
69+
@Description("""
7770
When enabled, OCI (and Docker) container images are pulled and converted to the SIF format by the Apptainer run command, instead of Nextflow (default: `false`).
7871
""")
7972
public boolean ociAutoPull;
8073

81-
@ConfigOption("""
74+
@ConfigOption
75+
@Description("""
8276
The amount of time the Apptainer pull can last, exceeding which the process is terminated (default: `20 min`).
8377
""")
8478
public Duration pullTimeout;
8579

86-
@ConfigOption("""
80+
@ConfigOption
81+
@Description("""
8782
The registry from where Docker images are pulled. It should be only used to specify a private registry server. It should NOT include the protocol prefix i.e. `http://`.
8883
""")
8984
public String registry;
9085

91-
@ConfigOption("""
86+
@ConfigOption
87+
@Description("""
9288
This attribute can be used to provide any extra command line options supported by `apptainer exec`.
9389
""")
9490
public String runOptions;

modules/compiler/src/main/java/config/scopes/AwsBatchConfig.java

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,95 +19,93 @@
1919

2020
import nextflow.config.dsl.ConfigOption;
2121
import nextflow.config.dsl.ConfigScope;
22+
import nextflow.script.dsl.Description;
2223
import nextflow.script.types.Duration;
2324

2425
public class AwsBatchConfig implements ConfigScope {
2526

26-
public AwsBatchConfig() {}
27-
28-
@Override
29-
public String name() {
30-
return "aws.batch";
31-
}
32-
33-
@Override
34-
public String description() {
35-
return """
36-
The `aws` scope controls the interactions with AWS, including AWS Batch and S3.
37-
38-
[Read more](https://nextflow.io/docs/latest/reference/config.html#aws)
39-
""";
40-
}
41-
42-
@ConfigOption("""
27+
@ConfigOption
28+
@Description("""
4329
The path where the AWS command line tool is installed in the host AMI.
4430
""")
4531
public String cliPath;
4632

47-
@ConfigOption("""
33+
@ConfigOption
34+
@Description("""
4835
Delay between download attempts from S3 (default: `10 sec`).
4936
""")
5037
public Duration delayBetweenAttempts;
5138

52-
@ConfigOption("""
39+
@ConfigOption
40+
@Description("""
5341
The AWS Batch Execution Role ARN that needs to be used to execute the Batch Job.
5442
5543
[Read more](https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html)
5644
""")
5745
public String executionRole;
5846

59-
@ConfigOption("""
47+
@ConfigOption
48+
@Description("""
6049
The AWS Batch Job Role ARN that needs to be used to execute the Batch Job.
6150
""")
6251
public String jobRole;
6352

64-
@ConfigOption("""
53+
@ConfigOption
54+
@Description("""
6555
The name of the logs group used by Batch Jobs (default: `/aws/batch`).
6656
""")
6757
public String logsGroup;
6858

69-
@ConfigOption("""
59+
@ConfigOption
60+
@Description("""
7061
Max parallel upload/download transfer operations *per job* (default: `4`).
7162
""")
7263
public int maxParallelTransfers;
7364

74-
@ConfigOption("""
65+
@ConfigOption
66+
@Description("""
7567
Max number of execution attempts of a job interrupted by a EC2 spot reclaim event (default: `5`)
7668
""")
7769
public int maxSpotAttempts;
7870

79-
@ConfigOption("""
71+
@ConfigOption
72+
@Description("""
8073
Max number of downloads attempts from S3 (default: `1`).
8174
""")
8275
public int maxTransferAttempts;
8376

84-
@ConfigOption("""
77+
@ConfigOption
78+
@Description("""
8579
The compute platform type used by AWS Batch. Can be either `ec2` or `fargate`.
8680
""")
8781
public String platformType;
8882

89-
@ConfigOption("""
83+
@ConfigOption
84+
@Description("""
9085
The retry mode used to accommodate rate-limiting on AWS services. Can be one of `standard`, `legacy`, `adaptive`, or `built-in` (default: `standard`).
9186
9287
[Read more](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-retries.html)
9388
""")
9489
public String retryMode;
9590

96-
@ConfigOption("""
91+
@ConfigOption
92+
@Description("""
9793
The scheduling priority for all tasks when using fair-share scheduling for AWS Batch (default: `0`).
9894
9995
[Read more](https://aws.amazon.com/blogs/hpc/introducing-fair-share-scheduling-for-aws-batch/)
10096
""")
10197
public int schedulingPriority;
10298

103-
@ConfigOption("""
99+
@ConfigOption
100+
@Description("""
104101
The share identifier for all tasks when using fair-share scheduling for AWS Batch.
105102
106103
[Read more](https://aws.amazon.com/blogs/hpc/introducing-fair-share-scheduling-for-aws-batch/)
107104
""")
108105
public String shareIdentifier;
109106

110-
@ConfigOption("""
107+
@ConfigOption
108+
@Description("""
111109
One or more container mounts. Mounts can be specified as simple e.g. `/some/path` or canonical format e.g. `/host/path:/mount/path[:ro|rw]`.
112110
""")
113111
public List<String> volumes;

0 commit comments

Comments
 (0)