Code Monkey home page Code Monkey logo

glice's People

Contributors

daniel-houston avatar kishaningithub avatar lykathia avatar reuvenharrison avatar ribice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

glice's Issues

Build not passing because of API limit

TravisCI build is not passing, due to test expecting a license from GitHub's API response. Due to rate limiting, it doesn't return anything and therefore test fails.

ToDo: Mock response from GitHub API in tests to prevent such error.

Support for go modules

When running glice in a project using go modules, not in the regular gopath you get the error:

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.main()
	/home/tommy/go/src/github.com/ribice/glice/main.go:64 +0x758

Verbose logging as glice is running

I currently have glice running for a repository for about 10 minutes with no update, and its not clear to me that it has stalled or if it is fetching something slowly.

Is there a way to enable verbose logging for glice?

Installing glice fails

I'm having issues installing glice, partially because v2.0.0 for instance has been released but go.mod does not comply with what Go expects (/v2 has to be the suffix), but also all the README commands do not seem to work. I have installed other CLI tools without issues. Here's a screenshot:

CleanShot 2022-01-13 at 21 12 15

As for the v2 go.mod name, see here how major versioning in Go works (not very intuitive :D): https://go.dev/blog/v2-go-modules

go install github.com/ribice/glice/[email protected]
go install: github.com/ribice/glice/[email protected]: github.com/ribice/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

SIGSEGV

Hi, it just crashes.

$ glice
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x13c1f1d]

goroutine 1 [running]:
main.(*deps).exists(0xc0000d5e28, 0xc000270caf, 0x16, 0xa00, 0xc000270c80)
	/Users/bblay/go/src/github.com/ribice/glice/main.go:180 +0xdd
main.(*deps).getDeps(0xc0000d5e28, 0xc000182f3c, 0x18)
	/Users/bblay/go/src/github.com/ribice/glice/main.go:158 +0x37d
main.main()
	/Users/bblay/go/src/github.com/ribice/glice/main.go:81 +0x564

Release binaries

Since this is a "binary only dependency" i would personally prefer having only the binary, effectively improve my CI build time

I also suggest the awesome https://goreleaser.com/ to automate creation and publish of binaries. What do you think ?

Fetch dependencies for correct version

Glice currently parses dependencies from go.mod without taking version number into account.

As licenses may change over time, it may produce invalid results.

Client library for GitHub doesn't provide option to fetch License at given version/commit.

Passing a non-existent directory to the `-p` argument causes a panic.

Passing a non-existent directory to the -p argument causes a panic.

> ls $GOPATH/src
github.com
> glice -p example.com/some/repo
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x13bdbfd]

goroutine 1 [running]:
main.getFolders.func1(0xc0000e40c0, 0x2e, 0x0, 0x0, 0x1559cc0, 0xc00015a000, 0x2, 0x2)
        /Users/dhouston/go/pkg/mod/github.com/ribice/[email protected]/main.go:115 +0x5d
path/filepath.Walk(0xc0000e40c0, 0x2e, 0xc0000c6900, 0x14c6aad, 0x1)
        /usr/local/Cellar/go/1.12.5/libexec/src/path/filepath/path.go:402 +0x6a
main.getFolders(0xc0000e4090, 0x2d, 0x0, 0x0, 0x0, 0x1, 0xc0000ca660)
        /Users/dhouston/go/pkg/mod/github.com/ribice/[email protected]/main.go:113 +0x175
main.main()
        /Users/dhouston/go/pkg/mod/github.com/ribice/[email protected]/main.go:81 +0x50b

By adding a check on line 114 of main.go for err != nil, I now get the following output

    checkErr(filepath.Walk(fullPath+".", func(path string, info os.FileInfo, err error) error {                
         if err != nil {                                                                                        
             return err                                                                                         
         }
         ...                 
> glice -p example.com/some/repo
2019/07/18 11:46:25 lstat /Users/dhouston/go/src/example.com/some/repo/.: no such file or directory

Small change to make things a little more user friendly. Happy to submit a merge request

Command 'glice' not found

have run these command go get github.com/ribice/glice; go install github.com/ribice/glice, but in $GOPATH folder to run glice command , the error is Command 'glice' not found.

Versioned release

It would be really useful if you could tag and release v1.0.0

Given it is integrated with go releaser we should be able to download the binary instead of downloading source using go get and do compilation

Dynamically fetch import paths

When the dependency isn't on a well know repo (like github) there is an option to dynamically fetch the import path over https/http and discover where the code resides from a tag in the HTML

This is described here:
https://golang.org/cmd/go/#hdr-Remote_import_paths

For example, if you have a dependency on go.uber.org/zap, you can run:
curl go.uber.org/zap
And see that the repo is actually on github:

<!DOCTYPE html>
<html>
    <head>
        <meta name="go-import" content="go.uber.org/zap git https://github.com/uber-go/zap">
        <meta name="go-source" content="go.uber.org/zap https://github.com/uber-go/zap https://github.com/uber-go/zap/tree/master{/dir} https://github.com/uber-go/zap/tree/master{/dir}/{file}#L{line}">
        <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/zap">
    </head>
    <body>
        Nothing to see here. Please <a href="https://godoc.org/go.uber.org/zap">move along</a>.
    </body>
</html>

Feature: export markdown table

I would really like the dependency, repourl and licence columns exported as a markdown table (can be just output, exporting on command line is easy enough through pipes) as this is great info to show for a repo in an md file when browsing on github

glice does not detect any licences for some projects

hello, we have a task for checking if the project's dependencies are EPL 2.0 compatible eclipse-che/che#16321

glice looked like a proper tool for that, but for some reason no detections happens:

[ibuziuk@fedora kubernetes-image-puller]$ glice
+--------------------------------------+---------+---------+
|              DEPENDENCY              | REPOURL | LICENSE |
+--------------------------------------+---------+---------+
| k8s.io/client-go/kubernetes          |         |         |
| k8s.io/client-go/rest                |         |         |
| k8s.io/client-go/tools/clientcmd     |         |         |
| k8s.io/api/apps/v1                   |         |         |
| k8s.io/api/core/v1                   |         |         |
| k8s.io/apimachinery/pkg/api/errors   |         |         |
| k8s.io/apimachinery/pkg/api/resource |         |         |
| k8s.io/apimachinery/pkg/apis/meta/v1 |         |         |
| k8s.io/apimachinery/pkg/watch        |         |         |
+--------------------------------------+---------+---------+
[ibuziuk@fedora kubernetes-image-puller]$ glice -c
+--------------------------------------+---------+---------+-------+
|              DEPENDENCY              | REPOURL | LICENSE | COUNT |
+--------------------------------------+---------+---------+-------+
| k8s.io/client-go/kubernetes          |         |         |     2 |
| k8s.io/client-go/rest                |         |         |     1 |
| k8s.io/client-go/tools/clientcmd     |         |         |     1 |
| k8s.io/api/apps/v1                   |         |         |     1 |
| k8s.io/api/core/v1                   |         |         |     1 |
| k8s.io/apimachinery/pkg/api/errors   |         |         |     1 |
| k8s.io/apimachinery/pkg/api/resource |         |         |     1 |
| k8s.io/apimachinery/pkg/apis/meta/v1 |         |         |     1 |
| k8s.io/apimachinery/pkg/watch        |         |         |     1 |
+--------------------------------------+---------+---------+-------+

is this expected or there is some known issue? Currently we have to check licenses manually e.g.

k8s.io/client-go/kubernetes -> https://github.com/kubernetes/client-go/blob/master/LICENSE -> Apache 2.0

Doesn't seem to support deps with vanity URLs

I have a project which imports go.uber.org/atomic (points to https://github.com/uber-go/atomic).

glice does not pick up a License for this project even though it has an MIT license in the repo.

I suspect this is because it isn't following the vanity URL metadata redirect.

$ curl -v https://go.uber.org/atomic

<!DOCTYPE html>
<html>
    <head>
        <meta name="go-import" content="go.uber.org/atomic git https://github.com/uber-go/atomic">
        <meta name="go-source" content="go.uber.org/atomic https://github.com/uber-go/atomic https://github.com/uber-go/atomic/tree/master{/dir} https://github.com/uber-go/atomic/tree/master{/dir}/{file}#L{line}">
        <meta http-equiv="refresh" content="0; url=https://godoc.org/go.uber.org/atomic">
    </head>
    <body>
        Nothing to see here. Please <a href="https://godoc.org/go.uber.org/atomic">move along</a>.
    </body>
</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.