Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the --version output is easy to parse #2856

Closed
pombredanne opened this issue Feb 7, 2022 · 0 comments · Fixed by #2858
Closed

Ensure the --version output is easy to parse #2856

pombredanne opened this issue Feb 7, 2022 · 0 comments · Fixed by #2858

Comments

@pombredanne
Copy link
Member

Today's output of the --version option requires some work to be parsed:

$ ./scancode --version
ScanCode version 30.1.0
ScanCode Output Format version 2.0.0
SPDX License list version 3.15

we should instead make it valid YAML such that this is easy to read for human and parse for tools:

$ ./scancode --version
ScanCode version: 30.1.0
ScanCode Output Format version: 2.0.0
SPDX License list version: 3.15

This would be enough!

$ python
>>> import saneyaml
>>> a='''ScanCode version: 30.1.0
... ScanCode Output Format version: 2.0.0
... SPDX License list version: 3.15
... '''
>>> saneyaml.load(a)
{'ScanCode version': '30.1.0', 'ScanCode Output Format version': '2.0.0', 'SPDX License list version': '3.15'}

@pombredanne pombredanne changed the title Ensure the --version is easy to parse Ensure the --version output is easy to parse Feb 7, 2022
KevinJi22 added a commit to KevinJi22/scancode-toolkit that referenced this issue Feb 8, 2022
This commit changes the --version output from

```
$ ./scancode --version
ScanCode version 30.1.0
ScanCode Output Format version 2.0.0
SPDX License list version 3.15
```

to

```
$ ./scancode --version
ScanCode version: 30.1.0
ScanCode Output Format version: 2.0.0
SPDX License list version: 3.15
```

This will make the output easier to parse since it is valid YAML now.

Signed-off-by: KevinJi22 <kyji1011@gmail.com>
KevinJi22 added a commit to KevinJi22/scancode-toolkit that referenced this issue Feb 8, 2022
This commit adds a colon so the --version output goes from

ScanCode version 30.1.0
ScanCode Output Format version 2.0.0
SPDX License list version 3.15

to

ScanCode version: 30.1.0
ScanCode Output Format version: 2.0.0
SPDX License list version: 3.15

This will make the output easier to parse since it is valid YAML now.

Signed-off-by: KevinJi22 <kyji1011@gmail.com>
KevinJi22 added a commit to KevinJi22/scancode-toolkit that referenced this issue Feb 8, 2022
This commit adds a colon so the --version output goes from

ScanCode version 30.1.0
ScanCode Output Format version 2.0.0
SPDX License list version 3.15

to

ScanCode version: 30.1.0
ScanCode Output Format version: 2.0.0
SPDX License list version: 3.15

This will make the output easier to parse since it is valid YAML now.

Signed-off-by: Kevin Ji <kyji1011@gmail.com>
KevinJi22 added a commit to KevinJi22/scancode-toolkit that referenced this issue Feb 8, 2022
This commit adds a colon so the --version output goes from

ScanCode version 30.1.0
ScanCode Output Format version 2.0.0
SPDX License list version 3.15

to

ScanCode version: 30.1.0
ScanCode Output Format version: 2.0.0
SPDX License list version: 3.15

This will make the output easier to parse since it is valid YAML now.
This also includes a test validating this behavior.

Signed-off-by: Kevin Ji <kyji1011@gmail.com>
pombredanne added a commit that referenced this issue Feb 8, 2022
Make --version output valid YAML for parsing #2856
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant