common-workflow-language / common-workflow-language/schema_salad

Warnings does not support `--print-oneline`

Open
#328 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

I confirmed it with the commit 0fe8c66.

# Input

error.cwl:
```cwl
#!/usr/bin/env cwl-runner

cwlVersion: v1.0a

class: CommandLineTool

hints:
- class: ResourceRequirement
coresMin: 2
ramMin: 8
- class: DockerRequirementXX
dockerPull: python:2-slim

inputs:
- id: reference
type: File
inputBinding: { position: 2 }

- id: reads
type:
type: array
items: File
inputBinding: { position: 3 }

- id: minimum_seed_length
type: int
inputBinding: { position: 1, prefix: -m }

- id: min_std_max_min
type: { type: array, items: int }
inputBinding:
position: 1
prefix: -I
itemSeparator: ","

- id: args.py
type: File
default:
class: File
location: args.py
inputBinding:
position: -1

outputs:
- id: sam
type: ["null", File]
outputBinding: { glob: output.sam }
- id: args
type:
type: array
items: string

baseCommand: python

arguments:
- bwa
- mem
- valueFrom: $(runtime.cores)
position: 1
prefix: -t

stdout: output.sam
```

# How to reproduce

```console
$ python -m schema_salad ../common-workflow-language/v1.0/CommonWorkflowLanguage.yml err.cwl --print-oneline
```

# Expected
Each warning is printed in one line as well as errors.

```console
$ python -m schema_salad ../common-workflow-language/v1.0/CommonWorkflowLanguage.yml err.cwl --print-oneline
/workspaces/schema_salad/schema_salad/__main__.py Current version: 5.1.20200519201404
err.cwl:11:5: checking item Field `class` contains undefined reference to `file:///workspaces/schema_salad/DockerRequirementXX`
err.cwl:40:7: Field `location` contains undefined reference to `file:///workspaces/schema_salad/args.py`
Document `err.cwl` failed validation:
err.cwl:3:1: Field `cwlVersion` contains undefined reference to `file:///workspaces/schema_salad/v1.0a`
```

# Actual
Each warning is printed using several lines even with `--print-oneline`. It makes harder to support warning highlighting.

```console
$ python -m schema_salad ../common-workflow-language/v1.0/CommonWorkflowLanguage.yml err.cwl --print-oneline
/workspaces/schema_salad/schema_salad/__main__.py Current version: 5.1.20200519201404
err.cwl:11:5: checking item
Field `class` contains undefined reference to
`file:///workspaces/schema_salad/DockerRequirementXX`
err.cwl:40:7: Field `location` contains undefined reference to
`file:///workspaces/schema_salad/args.py`
Document `err.cwl` failed validation:
err.cwl:3:1: Field `cwlVersion` contains undefined reference to `file:///workspaces/schema_salad/v1.0a`
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.