Giter Club home page Giter Club logo

depscheck's People

Contributors

dadabird avatar divan avatar kishaningithub avatar mattyw 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

depscheck's Issues

Dependencies?

I imagine some sort of dependency that I'm missing, though I got Golang tools loader. I don't know. I'm on Go 1.6. Maybe I need to update something?

# github.com/divan/depscheck
../sites/go/src/github.com/divan/depscheck/walker.go:73: w.P.Package undefined (type *loader.Program has no field or method Package)
../sites/go/src/github.com/divan/depscheck/walker.go:75: cannot use obj (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in argument to w.WalkObject:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
../sites/go/src/github.com/divan/depscheck/walker.go:123: cannot use pkg.Pkg (type *"golang.org/x/tools/go/types".Package) as type *"go/types".Package in argument to NewSelector
../sites/go/src/github.com/divan/depscheck/walker.go:131: cannot use pkg.Pkg (type *"golang.org/x/tools/go/types".Package) as type *"go/types".Package in argument to NewSelector
../sites/go/src/github.com/divan/depscheck/walker.go:166: w.P.Package undefined (type *loader.Program has no field or method Package)
../sites/go/src/github.com/divan/depscheck/walker.go:167: cannot use obj (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in argument to w.WalkObject:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
../sites/go/src/github.com/divan/depscheck/walker.go:186: invalid operation: def == obj (mismatched types "golang.org/x/tools/go/types".Object and "go/types".Object)
../sites/go/src/github.com/divan/depscheck/walker.go:187: cannot use def (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in return argument:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
../sites/go/src/github.com/divan/depscheck/walker.go:244: cannot use def (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in return argument:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope

compile errors in current Master branch

I just tried installing this app using Go 1.6 on OS X, and received several compile errors:

$ go get github.com/divan/depscheck
# github.com/divan/depscheck
Documents/gocode/src/github.com/divan/depscheck/walker.go:75: cannot use obj (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in argument to w.WalkObject:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
Documents/gocode/src/github.com/divan/depscheck/walker.go:123: cannot use pkg.Pkg (type *"golang.org/x/tools/go/types".Package) as type *"go/types".Package in argument to NewSelector
Documents/gocode/src/github.com/divan/depscheck/walker.go:131: cannot use pkg.Pkg (type *"golang.org/x/tools/go/types".Package) as type *"go/types".Package in argument to NewSelector
Documents/gocode/src/github.com/divan/depscheck/walker.go:167: cannot use obj (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in argument to w.WalkObject:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
Documents/gocode/src/github.com/divan/depscheck/walker.go:186: invalid operation: def == obj (mismatched types "golang.org/x/tools/go/types".Object and "go/types".Object)
Documents/gocode/src/github.com/divan/depscheck/walker.go:187: cannot use def (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in return argument:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope
Documents/gocode/src/github.com/divan/depscheck/walker.go:244: cannot use def (type "golang.org/x/tools/go/types".Object) as type "go/types".Object in return argument:
    "golang.org/x/tools/go/types".Object does not implement "go/types".Object (wrong type for Parent method)
        have Parent() *"golang.org/x/tools/go/types".Scope
        want Parent() *"go/types".Scope

Incorrect LOC used in presence of multiple levels of indirection

Or depscheck report Lumberjack as a good candidate for removing from dependencies, when it isn't:

 - Package lumberjack (gopkg.in/natefinch/lumberjack.v2) is a good candidate for removing from dependencies.

   Only 0 LOC used, in 1 calls, with 0 level of nesting

Standard usage pattern of Lumberjack is, to quote readme,

log.SetOutput(&lumberjack.Logger{
    Filename:   "/var/log/myapp/foo.log",
    MaxSize:    500, // megabytes
    MaxBackups: 3,
    MaxAge:     28, //days
})

with log interacting with inner implementation of lumberjack.Logger as io.WriteCloser.
This is misleading, and may be a good candidate to improve code or add as example of false positive in Readme.

Supporting "depscheck ./..."

I'd love to see a support for doing the stats recursively on all the sub packages of a certain package excluding the vendor directory.
Thanks.

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 ?

Omit internal packages

It would be nice to be able to exclude internal packages from checks. For instance with -omitinternal flag

E.g. I have some small subpackages in my package for separation of logic. Think it's a modules but not dependencies.

I can make PR for that.

What do you think?

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.