Skip to content

[FIX] CWL: positional options#237

Merged
eseiler merged 3 commits intoseqan:mainfrom
eseiler:fix/format_tdl
Feb 14, 2024
Merged

[FIX] CWL: positional options#237
eseiler merged 3 commits intoseqan:mainfrom
eseiler:fix/format_tdl

Conversation

@eseiler
Copy link
Copy Markdown
Member

@eseiler eseiler commented Feb 12, 2024

Needs API test patches if it is to be merged

@mr-c @SGSSGene Please check whether this is correct :)

I think:

  • Positional options should be required
  • Positional list options should be optional (and shown as list)
Here is the CWL from the last test (click)
label: default-index
doc: ""
inputs:
  positional_0:
    doc: this is a positional option.
    type: string
  positional_1:
    doc: "this is a positional option. Default: []"
    type: string[]?
  int:
    doc: "this is a int option. Default: 5"
    type: long?
    inputBinding:
      prefix: --int
  jint:
    doc: this is a required int option.
    type: long
    inputBinding:
      prefix: --jint
  percent:
    doc: this is a required float option.
    type: double
    inputBinding:
      prefix: --percent
  string:
    doc: "this is a string option (advanced). Default: \"\""
    type: string?
    inputBinding:
      prefix: --string
  path01:
    doc: "a normal file. Default: \"\". The input file must exist and read permissions must be granted."
    type: File?
    inputBinding:
      prefix: --path01
  path02:
    doc: "a normal file with a valid file extension. Default: \"\". The input file must exist and read permissions must be granted. Valid file extensions are: [.fa, .fasta]."
    type: File?
    inputBinding:
      prefix: --path02
  path03:
    doc: "a input directory. Default: \"\". An existing, readable path for the input directory."
    type: Directory?
    inputBinding:
      prefix: --path03
  path04:
    doc: "a output file. Default: \"\". The output file must not exist already and write permissions must be granted."
    type: string?
    inputBinding:
      prefix: --path04
  path05:
    doc: "a output directory. Default: \"\". A valid path for the output directory."
    type: string?
    inputBinding:
      prefix: --path05
  flag:
    doc: this is a flag.
    type: boolean?
  kflag:
    doc: this is a flag.
    type: boolean?
outputs:
  path04:
    type: File?
    outputBinding:
      glob: $(inputs.path04)
  path05:
    type: Directory?
    outputBinding:
      glob: $(inputs.path05)
cwlVersion: v1.2
class: CommandLineTool
baseCommand:
  - format_cwl_test
  - index
$ cwltool --validate test.cwl
test.cwl:45:3: object id `test.cwl#path04` previously defined
test.cwl:50:3: object id `test.cwl#path05` previously defined
test.cwl is valid CWL.

path04 and path05 occur in both input and output. I'm not sure if this is a warning or just a note by the cwltool?

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
sharg-parser ✅ Ready (Inspect) Visit Preview Feb 14, 2024 11:36am

@eseiler eseiler requested review from SGSSGene and mr-c February 12, 2024 11:46
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 12, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 12, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 12, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3b55514) 91.94% compared to head (fb246f5) 92.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   91.94%   92.01%   +0.07%     
==========================================
  Files          17       17              
  Lines        1627     1629       +2     
==========================================
+ Hits         1496     1499       +3     
+ Misses        131      130       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eseiler eseiler marked this pull request as ready for review February 13, 2024 09:23
Copy link
Copy Markdown
Contributor

@SGSSGene SGSSGene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you

@SGSSGene
Copy link
Copy Markdown
Contributor

The CWL warning is not beautiful, but was there before and should be fixed in TDL at some point.

@eseiler eseiler enabled auto-merge February 14, 2024 11:36
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 14, 2024
@eseiler eseiler merged commit 4b75957 into seqan:main Feb 14, 2024
@eseiler eseiler deleted the fix/format_tdl branch February 14, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants