-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Include Copyright owner/date in HTML license report; show multiple licenses #114
Conversation
# Conflicts: # src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
Can you resolve the conflicts? |
I resolved the conflicts. The edit in GitHub dropped a }, which I've fixed locally but not pushed yet. However... I also realized I hadn't run the regressions, and expected that it would fail because of my changes. I tried to fix that, and ran up against test harness problems. (Several.) Details follow below. Before getting into the test harness issues, there are a couple of cosmetic issues that I'm stuck on. I don't like to blame the tools, but in this case I'm stumped and it really does look like the tools to me. (I've been doing this stuff for a very long time, so that statement is not lightly made, but I also freely admit I could be wrong.) The resulting HTML has some problems with whitespace/indentations around the Here's a snippet. Note where the
The problems I've run across in the test harness are not yours, I don't think, but I'm not sure how to hack around them. (Only the first of the errors is reported at any time, so you have to unmask them one at a time.) Let me know how you'd like to proceed. (My preference is to check the "right answer" in "as intended", and try to fix the test harness over time - but that's messy for you!)
Note the caret under the \U - it looks as if it's trying to treat the Windows path separator as an escape. I'm inclined to fix everything else however we decide to do it, and rely on the automated testing to deal with that (give up testing on Windows). (Yeah, I know, "Windows"...). Lastly, for the record if you haven't seen it, I'm seeing a gripe about Groovy internals. Presumably someone is working on it, but for the record:
|
Over night it occurred to me to look at exactly what assertHtml did (I had assumed it was a built-in). The problem is that it's comparing XML when the input is HTML, and it matters in this case. I didn't see any HTML comparison tools similar to DiffBuilder, and I suspect that |
@DonnKey If you have a better library or way to compare the HTML, please let me know. |
I don't know of anything that would work directly, and didn't find anything on the web that looked at all promising. Pre-transforming the strings to make them into something the XML comparison will accept seems possible (subject to actually trying it). Of course, straight string comparison would work but be less resilient to unintended changes (such as the indentation of |
The remaining failure is in comparing some Unicode characters that seem to be being changed/escaped differently on Windows and (presumably) Linux. It works fine for me locally. I'll do something to "neutralize" the difference. |
src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
Outdated
Show resolved
Hide resolved
I want all the imports. You can update your intellij settings to not use
star imports.
…On Wed, Oct 30, 2019, 9:19 AM DonnKey ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/main/kotlin/com/jaredsburrows/license/internal/report/HtmlReport.kt
<#114 (comment)>
:
> import com.jaredsburrows.license.internal.pom.Project
-import kotlinx.html.A
-import kotlinx.html.FlowOrInteractiveOrPhrasingContent
-import kotlinx.html.HtmlTagMarker
-import kotlinx.html.a
-import kotlinx.html.attributesMapOf
-import kotlinx.html.body
-import kotlinx.html.h3
-import kotlinx.html.head
-import kotlinx.html.html
-import kotlinx.html.li
-import kotlinx.html.pre
+import kotlinx.html.*
I can do that, but help me understand the value of that. I didn't make the
change purely on my own: IntellIJ inserted the wildcard and then reported
duplicate imports.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#114?email_source=notifications&email_token=AANIYSC3R5QZGFG4BJXCGE3QRGXZPA5CNFSM4JEYC6A2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCJYCIPI#discussion_r340719708>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANIYSCDQ7BBPA2W36I7P6LQRGXZPANCNFSM4JEYC6AQ>
.
|
If we are updating the output, should we also update the README.md? |
README is mostly done. I left the indentation problems with the HTML as is. Let me know (either way, please) if you'd prefer that to be corrected in the README for readability reasons. The CHANGELOG doesn't seem to need anything from me. |
@DonnKey It would be nice to keep the README.md up to date with the code. This way people know what they are getting when they use the plugin. |
src/main/kotlin/com/jaredsburrows/license/internal/LicenseHelper.kt
Outdated
Show resolved
Hide resolved
// this exact case, so update as needed. | ||
text = text.replaceAll('<br>', '<br/>') | ||
text = text.replaceAll('<hr>', '<hr/>') | ||
text = text.replaceAll('©', '(c)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last thing before we merge, why remove copy with (c)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML comparison recognizes that © is an "entity" (ampersand-semicolon), but doesn't have the copyright entity built-in, yielding a complaint about "undefined entity" and failing the test. The replacement doesn't really matter, but that seemed obvious. (The message the XML comparison generates is obvious only after you've figured out what it means!)
<title>Open source licenses</title> | ||
</head> | ||
<body> | ||
<h3>Notice for packages:</h3> | ||
<ul> | ||
<li> | ||
<a href="#314129783">appcompat-v7</a> | ||
<li><a href="#1934118923">appcompat-v7 (26.1.0)</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last thing before we merge, can we remove the parentheses around the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that explicitly so that if there wasn't a version (theoretically possible, but, granted, unlikely) there'd be an obvious placeholder that could be edited. I don't mind making the change, but there was a reason for doing it this way. If you still want a change, would you prefer no placeholder or some other placeholder?
Thanks! |
This change addresses issue #109 (nee #50) about including Copyright text in the report.
It also handles the rare (but real -- see "Checker Qual") case where there are multiple license kinds by including all the licenses. Some minor changes to improve readability of both the raw html and the final result.
The raw information in the POM is often incomplete in this regard, so it makes a "best guess" when that happens. Those are easily discovered and edited in the raw html if needed.
Incidentally, it also adds another spelling of the MIT license URL (with a .php suffix). I didn't check whether the other "standard" licenses have that form.