spdx / LicenseListPublisher

Tool that generates license data found in the license-list-data repository from the license-list-XML source
Apache License 2.0
11 stars 18 forks source link

Make tag names unique #105

Closed m1kit closed 1 year ago

m1kit commented 3 years ago

See: https://github.com/m1kit/license-matcher-python/issues/1#issuecomment-851017637

m1kit commented 3 years ago

It's easy to generate names like bullet-1, bullet-2, but not sure it's appropirate. Needs more discussion.

goneall commented 3 years ago

Agree it needs some additional discussion. We should either update the spec to not require unique names or update the generator to produce unique names. Since no one has opened an issue on the name uniqueness, perhaps we should update the spec.

m1kit commented 3 years ago

For reference, here is my opinion. Let's think about a license generation service for open source library developers. Developers can generate his own license by filling in the var tag in the license template.

Variables such as copyrightHolder can appear in multiple places in the license, and most of the time they are all assigned the same string. It is desirable that all such var tags have the same name. On the other hand, tags for bullet may be assigned different strings. I think such var tags should have unique names.

goneall commented 3 years ago

I was considering adding some form of numbering to the generated bullet var tag, but it looks like it would require a bit of a redesign.

The generation is done through static methods in the LicenseXmlHelper class. To keep track of a counter we would have to change this from a static class to a POJO with the counter as a property. Another approach would be to pass the counters in as parameters, but that would be a bit ugly.

Since this is a bit of work, I'm going to postpone fixing this until the next iteration of the LicenseListPublisher tool.

m1kit commented 3 years ago

One question, do we have a tool to generate license documents by replacing var tags? As we release yalm, I think we need to show how to generate a license that is compliant with our templates.

goneall commented 3 years ago

@m1kit If I understand your question correctly, the LicenseListPublisher previously generated full license text replacing the var tag with the orginal= text.

This was replaced by copying the test file text to resolve an issue where we lost formatting. It wouldn't be hard to bring this back or add another generated format.

This tool also generates HTML using the same approach to replace the var tags.

goneall commented 3 years ago

The value of the useTestText parameter in the writeLicenseList controls whether the file is generated or the test text is used.

m1kit commented 3 years ago

Sorry, I was not clear enough.

I meant a tool for developers to generate license documentation for their software when they develop new software. For example, a web app where you can type your name in a text box and the license holder part will be automatically replaced.

goneall commented 3 years ago

@m1kit I don't know of a tool that generates the actual text, but the REUSE project in FSFE has some tools that generates license identifier comments which serves a similar purpose. You may want to check with that organization to see if their tools provide this.

goneall commented 1 year ago

This is likely an issue for a different tool/repo - closing.