-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
--new-from-rev doesn't work on Windows #972
Labels
Comments
ernado
added
bug
Something isn't working
blocked
Need's direct action from maintainer
labels
Feb 28, 2020
I have the same problem, And seems there is a PR already fix this but doesn't merge. |
It's open-source, if you think that the fix is quite straightforward, you can fix it, PRs are welcome. |
I missed the link to the PR. The changes can be seen as trivial but evaluating the possible regression is complex and time-consuming. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
TL;DR:
revgrep
tool usesgit diff
command to collect changed lines. On Windowsgit diff
output contains file paths with forward slashes. But linters output contains file paths with backslashes. Whenrevgrep
searches changed lines for a linter warning it cannot find a match because paths are not equalI found this issue when I tried to run
golangci-lint
in our project. Without--new-from-rev
option it produces the same output on macOS and Windows. With the option it produces correct output on macOS and empty output on WindowsVerbose output of running on macOS
Verbose output of running on Windows
Diff on macOS
Diff on Windows
Processors filtering stat helps to narrow the circle: macOS output has
diff: 1/14
when Windows output hasdiff: 0/14
. Sincegolangci-lint
has no debug option to debug diff processor, I've installedrevgrep
tool and executed it separately onerrcheck
results. Seems it searches changed lines for a linter warning but cannot find a match because path from linter output has backslashes and path fromgit diff
has forward slashesOutput on macOS
Output on Windows
Sorry I cannot paste the entire debug output of
revgrep
since it is too large. Hope the info I provided can help. If not, fill free to ask meThank you for creating the issue!
Please include the following information:
Version of golangci-lint
Config file
Go environment
The text was updated successfully, but these errors were encountered: