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

Specifying a directory with the CLI option -d does not work #407

Open
geertjanvdk opened this issue Feb 25, 2023 · 1 comment
Open

Specifying a directory with the CLI option -d does not work #407

geertjanvdk opened this issue Feb 25, 2023 · 1 comment

Comments

@geertjanvdk
Copy link

The result when running the goreportcard-cli tool with the option -d is not as expected.

For example:

$ go run ./cmd/goreportcard-cli                   
2023/02/25 09:33:15 disabling ineffassign on large repo...
2023/02/25 09:33:15 disabling misspell on large repo...
Grade ........... A+ 98.1%
Files ................ 850
Issues ............... 140

The above correctly takes the current directory. It is the same as go run ./cmd/goreportcard-cli -d ..

However, when specifying the actual folder as ../goreportcard, it does not walk the tree correctly:

go run ./cmd/goreportcard-cli -d ../goreportcard
Grade ............ D 56.3%
Files ................. 38
Issues ............... 141

Note the number of issues, which is very similar.

I could not pinpoint where it fails in GoFiles-function, but it is probably better to actually change directory (using os.Chwd), and then use the current directory. Doing it that way works great.

Why I need this? Because I am preparing another PR and I wanted to add a test :)

@texadactyl
Copy link

It looks like check/check.go function Run and/or possibly check/utils.go function GoFiles are/is having some tree walking issues. Been in that sort of soup myself.

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

No branches or pull requests

2 participants