Skip to content

Commit

Permalink
Apply suggestions from review
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Oct 1, 2024
1 parent c53cdc2 commit 01b9c52
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,8 @@ The following settings are available:
- `affiliation`: the contributor's affiliated organization
- `email`: the contributor's email address
- `github`: the contributor's GitHub URL
- `contribution`: list of contributions, can be any of `'author'`, `'maintainer'`
- `orcid`: the contributor's [ORCID](https://orcid.org/)
- `contribution`: list of contribution types, each element can be one of `'author'`, `'maintainer'`, or `'contributor'`
- `orcid`: the contributor's [ORCID](https://orcid.org/) URL

`manifest.defaultBranch`
: Git repository default branch (default: `master`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class Manifest {
String affiliation
String email
String github
Set<Contribution> contribution
Set<ContributionType> contribution
String orcid

Contributor(Map opts) {
Expand All @@ -167,14 +167,15 @@ class Manifest {
email = opts.email as String
github = opts.github as String
contribution = (opts.contribution as List<String>).stream()
.map(c -> Contribution.valueOf(c.toUpperCase()))
.map(c -> ContributionType.valueOf(c.toUpperCase()))
.collect(Collectors.toSet())
orcid = opts.orcid as String
}
}

static enum Contribution {
static enum ContributionType {
AUTHOR,
MAINTAINER
MAINTAINER,
CONTRIBUTOR
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package nextflow.config

import nextflow.exception.AbortOperationException
import spock.lang.Specification

import static nextflow.config.Manifest.ContributionType
/**
*
* @author Paolo Di Tommaso <[email protected]>
Expand All @@ -35,12 +37,13 @@ class ManifestTest extends Specification {
affiliation: 'University',
email: '[email protected]',
contribution: ['author', 'maintainer'],
orcid: 'https://orcid.org/0000-0000-0000-0000'
],
[
name: 'Bob',
affiliation: 'Company',
email: '[email protected]',
contribution: ['maintainer'],
contribution: ['contributor'],
]
],
nextflowVersion: '1.2.3',
Expand All @@ -54,20 +57,16 @@ class ManifestTest extends Specification {
def manifest = new Manifest(MAN)
then:
manifest.author == 'pablo'
manifest.contributors == [
new Manifest.Contributor([
name: 'Alice',
affiliation: 'University',
email: '[email protected]',
contribution: ['author', 'maintainer'],
]),
new Manifest.Contributor([
name: 'Bob',
affiliation: 'Company',
email: '[email protected]',
contribution: ['maintainer'],
])
]
manifest.contributors.size() == 2
manifest.contributors[0].name == 'Alice'
manifest.contributors[0].affiliation == 'University'
manifest.contributors[0].email == '[email protected]'
manifest.contributors[0].contribution == [ContributionType.AUTHOR, ContributionType.MAINTAINER] as Set
manifest.contributors[0].orcid == 'https://orcid.org/0000-0000-0000-0000'
manifest.contributors[1].name == 'Bob'
manifest.contributors[1].affiliation == 'Company'
manifest.contributors[1].email == '[email protected]'
manifest.contributors[1].contribution == [ContributionType.CONTRIBUTOR] as Set
manifest.nextflowVersion == '1.2.3'
manifest.name == 'foo'
manifest.organisation == 'My Organisation'
Expand Down

0 comments on commit 01b9c52

Please sign in to comment.