ccin2p3 / go-freeipa

A generated golang client for the FreeIPA API.
Other
7 stars 15 forks source link

Documentation unavailable due to unspecified license #5

Closed PrMinisterGR closed 10 months ago

PrMinisterGR commented 2 years ago

Hi,

There is an error when trying to read documentation due to an unspecified license.

https://pkg.go.dev/github.com/ccin2p3/go-freeipa@v1.1.0/freeipa#section-documentation

PrMinisterGR commented 2 years ago

My question is more on how it would be possible to see the documentation at all. It seems that the license itself was accepted upstream, but it's still impossible to see the documentation.

riton commented 2 years ago

I totally agree that this is a problem.

I'm not quite sure what we should change on our side to make it work.

This will need further investigations on our LICENSE file.

If anyone has an idea, we'd be glad to hear it :-)

riton commented 2 years ago

I'm suspecting that this is due to the previous owner LICENSE file that was appended to the Cecill 2.1 LICENSE file.

riton commented 2 years ago

Reading https://pkg.go.dev/license-policy again, the licensecheck library is used to discover LICENSE.

I've made a simple test using the code and data bellow

Show code and data files ```golang package main import ( "fmt" "io" "os" "github.com/google/licensecheck" ) func main() { for _, licenseFile := range []string{"LICENSE.with_old_license_appended", "LICENSE.cecill21", "LICENSE.from_licensecheck_repo"} { fmt.Printf("Processing license file %s\n", licenseFile) fd, _ := os.Open(licenseFile + ".txt") text, _ := io.ReadAll(fd) fd.Close() cov := licensecheck.Scan(text) fmt.Printf("%.1f%% of text covered by licenses:\n", cov.Percent) for _, m := range cov.Match { fmt.Printf("%s at [%d:%d] IsURL=%v\n", m.ID, m.Start, m.End, m.IsURL) } fmt.Println() } } ``` with `go.mod`: ``` module licensetest go 1.19 require github.com/google/licensecheck v0.3.1 ``` Here are the data files I've used: [LICENSE.with_old_license_appended.txt](https://github.com/ccin2p3/go-freeipa/files/9674842/LICENSE.with_old_license_appended.txt) [LICENSE.from_licensecheck_repo.txt](https://github.com/ccin2p3/go-freeipa/files/9674844/LICENSE.from_licensecheck_repo.txt) [LICENSE.cecill21.txt](https://github.com/ccin2p3/go-freeipa/files/9674845/LICENSE.cecill21.txt)

Here's the output of the program:

Processing license file LICENSE.with_old_license_appended
4.5% of text covered by licenses:
MIT at [21885:22940] IsURL=false

Processing license file LICENSE.cecill21
0.0% of text covered by licenses:

Processing license file LICENSE.from_licensecheck_repo
100.0% of text covered by licenses:
BSD-3-Clause at [0:1479] IsURL=false

The raw Cecill 2.1 LICENSE file seem not to be recognized by the licensecheck library.

The current LICENSE file we're using is kinda recognized as a MIT license.

Further investigations is required.

PrMinisterGR commented 2 years ago

Hi, until then, can I somehow view the documentation locally at least?

PrMinisterGR commented 2 years ago

I did this by running godoc inside the pkg folder.

vudex commented 1 year ago

I made a PR for this one #12 @riton could you review, pls

riton commented 10 months ago

Thanks to @vudex for the fix. This should now be fixed :heavy_check_mark: