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

Pluggable output formats #381

Closed
pombredanne opened this issue Nov 27, 2016 · 7 comments
Closed

Pluggable output formats #381

pombredanne opened this issue Nov 27, 2016 · 7 comments

Comments

@pombredanne
Copy link
Member

Following discussions with @sschuberth in #375 we should have a simplified and better to handle output formats. The outline would be this:

  1. the only standard format for output would be JSON
  2. through a simple plugin mechanism and/or conventions, this could be transformed into other formats such as:
@pombredanne
Copy link
Member Author

So for plugins basics there are a few contenders:

All have some pros and cons. In all cases, combining these with setuptools entry points (even if built in) is the way to go IMHO.

@sschuberth
Copy link
Collaborator

sschuberth commented Feb 16, 2017

Creating other formats as a post-processing step from JSON also has the advantage of easily getting scan results in different formats from the same scan. Currently, if you would need both JSON and SPDX, you would need to run the scan twice.

pombredanne added a commit that referenced this issue Feb 17, 2017
 * this is a first step towards #381
 * code and tests have been split from the scancode module
 * Also restore the ability to run ScanCode as a library by vendoring
   the NOTICE file. This was a regression introduced in #424 and
   tracked as #468
   

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Feb 17, 2017
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Feb 17, 2017
 * thanks to @sschuberth for the review

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Feb 18, 2017
#381 Move scan formatters to a new "formattedcode" module
@pombredanne
Copy link
Member Author

Note: A plugin architecture is what is needed here. Some refinements on the formats is welcomed but is not the purpose. The purpose is to refactor the existing code for plugins.

@pombredanne
Copy link
Member Author

and each plugin for format should ideally be also runnable as its own CLI, with input = scan json (e.g. ABC Data format), output = other format

See for ABCD:
https://github.com/nexB/aboutcode/blob/a84e207bbe579dd9b419cc52bbfd00239f5beeb9/aboutcode-data/README.rst

@pombredanne pombredanne mentioned this issue Mar 10, 2017
4 tasks
@pombredanne
Copy link
Member Author

So format plugins have landed in develop thanks to @yashdsaraf with #639
There is no new features there for now except that there is a new CSV output plugin.
Beside this we need documentation on how to create plugins and likely implement the JSON-> other format conversion as discussed here.

@pombredanne
Copy link
Member Author

pombredanne commented Oct 4, 2017

This has been completed and merged in develop.

@sschuberth you wrote:

Creating other formats as a post-processing step from JSON also has the advantage of easily getting scan results in different formats from the same scan. Currently, if you would need both JSON and SPDX, you would need to run the scan twice.

Just ping as if we support #789 in the future, then we would need to have one option for each format such that we can specify which file each output should be written to.

@sschuberth
Copy link
Collaborator

we would need to have one option for each format such that we can specify which file each output should be written to.

Or, preferably, extend --format to take a comma separated list, like

--format json,spdx-tv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants