Skip to content
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

Running the reporter from another directory #11

Closed
antonsteenvoorden opened this issue Apr 12, 2017 · 2 comments
Closed

Running the reporter from another directory #11

antonsteenvoorden opened this issue Apr 12, 2017 · 2 comments

Comments

@antonsteenvoorden
Copy link

antonsteenvoorden commented Apr 12, 2017

This tool seems very useful and I really wanted to use this. But when trying out this neat tool I ran into a couple of issues.

I had an issue when runningthe reporter from the directory of the project I want to check.
I am using Glide as package manager.

When I executed:
goreporter -p . -r . -t $GOPATH/src/github.com/wgliang/goreporter/templates/template.html

I got:

[Apollo]2017/04/12 16:37:48 The report path is not specified, and the current path is used by default
[Apollo]2017/04/12 16:37:48 There are no packages that are excepted, review all items of the package
[Apollo]2017/04/12 16:37:48 start code quality assessment...
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.DirList.func1(0xc4202bb9a0, 0x19, 0x18d4160, 0xc42032fc70, 0x0, 0x0, 0x0, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/utils.go:30 +0x216
path/filepath.walk(0xc4202bb9a0, 0x19, 0x18d4160, 0xc42032fc70, 0xc4200f14d0, 0x0, 0x0)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0x7fff5fbffa9e, 0x1, 0x18d4160, 0xc420107790, 0xc4200f14d0, 0x0, 0x30)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:376 +0x414
path/filepath.Walk(0x7fff5fbffa9e, 0x1, 0xc4200f14d0, 0xc4201076c0, 0x0)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:398 +0x14c
main.DirList(0x7fff5fbffa9e, 0x1, 0x15a6ea3, 0x8, 0x0, 0x0, 0x1043f85, 0x10, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/utils.go:38 +0x1ec
main.(*Reporter).Engine(0xc42015c180, 0x7fff5fbffa9e, 0x1, 0x0, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/engine.go:44 +0x10c
main.main()
	/Users/anton/development/go/src/github.com/wgliang/goreporter/main.go:70 +0x378

Another issue I had was when I ran the goreporter from it's project folder (GitHub.com/wgliang/goreporter) and pointed to my project folder like so: goreporter -p ../../../munisense.com/services/result-aggregation-service-go/ -d ../goreporter -t ./templates/template.html it kept saying that I didn't have these dependencies installed (because I used glide) and that I should install them using go get.
Will there be support for vendoring?

Lastly: How can I only check the packages I have built? Not the dependencies? Do I have to list all of the dependencies as exceptions? That seems a bit too much effort.. 😞

Please let me know if I'm doing something wrong here.

EDIT: Using both v1.0.0 and HEAD

@wgliang
Copy link
Collaborator

wgliang commented Apr 13, 2017

Thank you for these useful questions:

Feedback:
goreporter -p . -r . -t $GOPATH/src/github.com/wgliang/goreporter/templates/template.html?

  • 1.This is my bug,I used to be a strict way to limit the way of writing for -p. In addition, -r you must specify a valid template file(May be my negligence misleading you). Now I fix in rewrite flags and fix project vendors fix#10 .
  • 2.Support all vendors.
    If there are errors, please point out.Thanks very much.

@antonsteenvoorden
Copy link
Author

antonsteenvoorden commented Apr 24, 2017

Im still having issues when running the reporter in my project folder when using the command you suggested:

[Apollo]2017/04/24 14:56:23 The report path is not specified, and the current path is used by default
[Apollo]2017/04/24 14:56:23 There are no packages that are excepted, review all items of the package
[Apollo]2017/04/24 14:56:23 start code quality assessment...
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.DirList.func1(0xc4203c7ac0, 0x14, 0x18d4160, 0xc42043bc70, 0x0, 0x0, 0x0, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/utils.go:30 +0x216
path/filepath.walk(0xc4203c7ac0, 0x14, 0x18d4160, 0xc42043bc70, 0xc420101440, 0x0, 0x0)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0x7fff5fbffad6, 0x1, 0x18d4160, 0xc42010d790, 0xc420101440, 0x0, 0x30)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:376 +0x414
path/filepath.Walk(0x7fff5fbffad6, 0x1, 0xc420101440, 0xc42010d6c0, 0x0)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:398 +0x14c
main.DirList(0x7fff5fbffad6, 0x1, 0x15a6ea3, 0x8, 0x0, 0x0, 0x1043f85, 0x10, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/utils.go:38 +0x1ec
main.(*Reporter).Engine(0xc420164180, 0x7fff5fbffad6, 0x1, 0x0, 0x0)
	/Users/anton/development/go/src/github.com/wgliang/goreporter/engine.go:44 +0x10c
main.main()
	/Users/anton/development/go/src/github.com/wgliang/goreporter/main.go:70 +0x378

Do you have a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants