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

Fix licenses in HTML output #3275

Merged
merged 5 commits into from
Apr 3, 2023
Merged

Fix licenses in HTML output #3275

merged 5 commits into from
Apr 3, 2023

Conversation

AyanSinhaMahapatra
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra commented Feb 24, 2023

Fixes #3272

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 📁

Fix an issue in HTML output where no licenses were being shown,
now we also use license references here.

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
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, but we need a test

@jbohrmann
Copy link

Hi, license text is not included in HTML-output. As I am new to scancode I am not sure if this is expected behavior.
I run scancode under windows (py 3.9).
I call it this way (--license-text-diagnostics also does not change the output):
scancode.bat -cleui -n 2 --html output.html . --license-score 2 --license-text --license-text-diagnostics

@AyanSinhaMahapatra
Copy link
Member Author

@jbohrmann can you confirm that you used the checkout of this branch?

git clone https://github.com/nexB/scancode-toolkit.git
git checkout fix-html-output
./configure --dev
 scancode -clipeu --html output.html samples/

I seem to have licenses fine from this branch, attaching here the output.html file I generated using these commands above:
output.html

Also --html is a very basic output format, and does not have support for most of the advanced CLI options such as the one you have used:

  • --license-score
  • --license-text
  • --license-text-diagnostics
    Use --json or --yaml to use all the supported CLI options.

@jbohrmann
Copy link

@jbohrmann can you confirm that you used the checkout of this branch?

git clone https://github.com/nexB/scancode-toolkit.git
git checkout fix-html-output
./configure --dev
 scancode -clipeu --html output.html samples/

I seem to have licenses fine from this branch, attaching here the output.html file I generated using these commands above: output.html

Also --html is a very basic output format, and does not have support for most of the advanced CLI options such as the one you have used:

  • --license-score
  • --license-text
  • --license-text-diagnostics
    Use --json or --yaml to use all the supported CLI options.

Yes I can confirm.
Here is the info from my .VERSION file:

refs=refs/pull/3275/head, fix-html-output

I preferred HTML as I can pass the output easily to get legal advice.

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

@jbohrmann what is your OS? also what is your installation process? Is it a git checkout or an app archive download? the .VERSION file looks like this https://github.com/nexB/scancode-toolkit/blob/develop/.VERSION when you are installing from a git checkout, what do you mean info from this file?
Can you do a git describe --tag for me and confirm that the output is v32.0.0rc2-2-g76795acd45 which is the last commit here?

See above the commit with added test for licenses in html, looks like they work fine now after these changes ^

@pombredanne
Copy link
Member

@AyanSinhaMahapatra @jbohrmann said it was Windows and Python 3.9 ;)

I run scancode under windows (py 3.9).

@pombredanne
Copy link
Member

but afaics, we do not include the license text be it the matched text or the reference text in the standard HTML output. Maybe we should. HTML is nicer than JSON for sure.

@AyanSinhaMahapatra
Copy link
Member Author

AyanSinhaMahapatra commented Mar 1, 2023

@pombredanne We could have support for license-text, summary, license-clarity-score and others too in the HTML output, I opened an issue for this: #3281.

@jbohrmann
Copy link

I downloaded the branch as zip over Github. OS is Windows 10.
Maybe it would be helpful to mention in the documentation that at the moment --html does not support all features.

@pombredanne
Copy link
Member

Maybe it would be helpful to mention in the documentation that at the moment --html does not support all features.

@jbohrmann you are right! Note that there are a few alternatives:

  • scancode.io provides a web ui to display the matched license text
  • it is possible otherwise to create a custom HTML template that would include the matched text

* Add named arguments and license_references as applicable
* Make --html-app a hidden argument
* Add homepage_url and tests for the same

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Copy link
Contributor

@JonoYang JonoYang left a comment

Choose a reason for hiding this comment

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

LGTM. I've tested out the HTML output on a scan of the samples directory and the results look great. Thanks!

@AyanSinhaMahapatra
Copy link
Member Author

Thanks @JonoYang , merging!

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit ac47da2 into develop Apr 3, 2023
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the fix-html-output branch April 3, 2023 10:08
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.

Docker run No license be detected!
4 participants