Skip to content

Make --version output valid YAML for parsing #2856 - #2858

Merged
pombredanne merged 1 commit into
aboutcode-org:developfrom
kji22:version-output-2856
Feb 8, 2022
Merged

Make --version output valid YAML for parsing #2856#2858
pombredanne merged 1 commit into
aboutcode-org:developfrom
kji22:version-output-2856

Conversation

@kji22

@kji22 kji22 commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

This commit adds a colon so instead of getting

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

we get

$ ./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. Fixes #2856

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁

@kji22
kji22 force-pushed the version-output-2856 branch from 7404481 to 9f177fd Compare February 8, 2022 05:01

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!
Could you add a small test to validate that this function returns valid YAML that can be parsed?

Comment thread src/scancode/cli.py Outdated
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>
@kji22
kji22 force-pushed the version-output-2856 branch from 9f177fd to b78b49f Compare February 8, 2022 08:16
@pombredanne

Copy link
Copy Markdown
Member

pytest-dev/pytest#9608 is likely the cause for the failures

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@pombredanne
pombredanne merged commit cec5846 into aboutcode-org:develop Feb 8, 2022
@kji22
kji22 deleted the version-output-2856 branch February 8, 2022 17:40
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.

Ensure the --version output is easy to parse

2 participants