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

add json and yaml reporters to the status command #303

Merged
merged 2 commits into from
Sep 23, 2020

Conversation

julianvilas
Copy link
Contributor

As for the env command, add the ability to use the json and yaml reporters to the status command. Those output formats are specified via the --format flag just like the env command. Defaults to the current status reporter.

Default

$ licensed status
Checking cached dependency records for licensed
............F.....
Errors:
* licensed.bundler.reverse_markdown
  filename: /Users/julianvilas/src/licensed/.licenses/bundler/reverse_markdown.dep.yml
    - license needs review: wtfpl


18 dependencies checked, 1 errors found.

JSON

$ licensed status --format json
{
  "apps": [
    {
      "name": "licensed",
      "sources": [
        {
          "name": "licensed.bundler",
          "dependencies": [
            {
              "name": "licensed.bundler.addressable",
              "filename": "/Users/julianvilas/src/licensed/.licenses/bundler/addressable.dep.yml"
            },
...
            {
              "name": "licensed.bundler.reverse_markdown",
              "errors": [
                "license needs review: wtfpl"
              ],
...
            {
              "name": "licensed.bundler.tomlrb",
              "filename": "/Users/julianvilas/src/licensed/.licenses/bundler/tomlrb.dep.yml"
            }
          ]
        }
      ]
    }
  ]
}

YAML

$ licensed status --format yaml
---
apps:
- name: licensed
  sources:
  - name: licensed.bundler
    dependencies:
    - name: licensed.bundler.addressable
      filename: "/Users/julianvilas/src/licensed/.licenses/bundler/addressable.dep.yml"
...
    - name: licensed.bundler.reverse_markdown
      errors:
      - 'license needs review: wtfpl'
      filename: "/Users/julianvilas/src/licensed/.licenses/bundler/reverse_markdown.dep.yml"
    - name: licensed.bundler.ruby-xxHash
      filename: "/Users/julianvilas/src/licensed/.licenses/bundler/ruby-xxHash.dep.yml"
...
    - name: licensed.bundler.tomlrb
      filename: "/Users/julianvilas/src/licensed/.licenses/bundler/tomlrb.dep.yml"

Copy link
Contributor

@jonabc jonabc left a comment

Choose a reason for hiding this comment

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

well that's nice and easy 😄 :shipit:

@julianvilas are you making this change to support a specific scenario? If so can you provide an ETA on when you need a release published that includes this change?

@jonabc
Copy link
Contributor

jonabc commented Sep 22, 2020

Ah sorry @julianvilas before this is merged would you mind adding similar tests that exist for the env command for the status command?

@julianvilas
Copy link
Contributor Author

Thanks for the super-fast reply :)

@julianvilas are you making this change to support a specific scenario? If so can you provide an ETA on when you need a release published that includes this change?

We wanted to get stats from a big list of repositories of different kinds. No rush at all because we can do it locally already, but we thought that maybe someone else may find it useful too.

Ah sorry @julianvilas before this is merged would you mind adding similar tests that exist for the env command for the status command?

Sure! Will add them tomorrow.

@julianvilas
Copy link
Contributor Author

@jonabc I've added the test already :)

@jonabc jonabc merged commit bb8789c into github:master Sep 23, 2020
@julianvilas julianvilas deleted the status-json branch September 23, 2020 15:06
@jonabc jonabc mentioned this pull request Sep 24, 2020
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.

2 participants