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

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

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

KevinJi22
Copy link
Collaborator

@KevinJi22 KevinJi22 commented Feb 8, 2022

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 📁

Copy link
Member

@pombredanne pombredanne left a comment

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?

src/scancode/cli.py Outdated Show resolved Hide resolved
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
Copy link
Member

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

Copy link
Member

@pombredanne pombredanne left a comment

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
@KevinJi22 KevinJi22 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