-
-
Notifications
You must be signed in to change notification settings - Fork 552
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
Support multiple outputs from a single scan #789
Comments
This probably should be supported via something like |
@sschuberth How would you pass the path to the output file for each format then? |
Ah, sorry, I was too much thinking about how our own pre-processor takes command line arguments. We have a If that's not flexible enough, I could also imagine I believe both suggestions above are more generic than having separate |
@sschuberth you wrote
I have thought of this approach, but that sounds to me as difficult to understand and removes control by the user of which files are created exactly. Passing a list of comma-separated file paths and inferring the format based on this feels also like a possible source of confusion.. I find it though to get the right CLI UI/UX here! Or may be this is the wrong way to look at this entirely? What if instead we had ONLY a json output in ScanCode and a few additional small tools that could convert this output to another format (CSV, HTML, SPDX, etc)? |
That's what we do right now, after all, as we need your own "flavor" of SPDX-TV. While that approach certainly has its advantages, the one thing that I don't like about it is that you lose visibility over what output formats are supported. I simply like it when |
@sschuberth so you want Current way
New way could be this:
You would still have a brief summary. Could something like this work for you? |
Subscribed, that would be useful for us. Thank you |
@sschuberth any feedback on my last comment? |
Sorry for my late feedback, @pombredanne. I somewhat like your suggested "New way" command line help, however, I'd prefer to have all output format options prefixed with Finally, I don't think there's much value in a separate brief summary. |
@sschuberth Thank you! FWIW the grouping comes for free from the fact that these are output plugins. I like your explicit As a side note (as least on POSIX) we could also add shell completion (which is built in @mitsuhiko Click library) |
* each plugin just process a Codebase (though there is still some code left to cleanup) * renamed options to --output * multiple outputs are now possible for #789 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Fixed in #885 ! |
Actually I have second thoughts about the new options names and their
And I wonder if it would not be better to have instead:
@sschuberth @eclipsewebmaster ping: any preferences? If not I might go with the later |
What I don't like about the first proposal is that the "--json*" options inconsistently have no "--output" prefix, but I guess there's no way to change that due to backwards compatibility. What I don't like about the second proposal is that So bottom line, if |
re:
This breaking compatibility in terms of CLI api anyway so we can do whatever we want alright! So let update things for custom... note that we could also have multiple forms assigned to each option (e.g. (Side note the latest Click will likely have built-in bash completion per https://github.com/pallets/click/blame/5210849f8fd0678998723014c711c93af6edd5ce/click/_bashcomplete.py thanks to @stopthatcow afaik) |
I would not over-do it. Let's have one long option for any of these, and one short option only for the most commonly used ones. |
I agree that we need to be cautious about short options since there are so many options. And the better solution for "remembering" the most commonly used options is a configuration file. |
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
So here the latest proposal on this based on @sschuberth excellent proposal in #789 (comment) and a little reordering:
|
The consistent use of FILE in the help text seems to make it clear that these are all output options. +1 |
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
Some output formats were prefixed with "output" while others were not. For the sake of consistency and simplicity, "output" is dropped as a prefix to these output options. Signed-off-by: Yash Nisar <yash.nisar@somaiya.edu>
#961 is merged in develop now. |
I am doing some cleanup and review as a prep for the 3.0 release... and since this is fixed in develop, I am closing this! |
Excuse me, this thread here was returned to me as a google result. Is there ANY documentation about the contents of the custom template file written in Jinja? I have no clue about the variable / object names that can be used in such a Jinja template of a scancode result... Tried many expressions from other google results like {{ results }} or {{ files_count }} (because it says so in the json result) - I can't get more than an empty file with the custom output. |
@Shaker1978 good point ... there is little or no doc for that. The only "doc" would be the example default HTML output template at https://github.com/nexB/scancode-toolkit/blob/bec80ec900a69285ea4e545dc0755061243a5638/src/formattedcode/templates/html/template.html and the code that renders the Jinja template at https://github.com/nexB/scancode-toolkit/blob/bec80ec900a69285ea4e545dc0755061243a5638/src/formattedcode/output_html.py#L165 I reckon this is pretty crass and light. Let's have a ticket to track this! |
It would be nice to have multiple outputs created at once. Today this requires re-running a scan as a scan has only a single output file.
The text was updated successfully, but these errors were encountered: