-
-
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
GoLint always runs against cwd, rather than the file that's open #1375
Comments
This is because GoLint works like that by default:
That's also how it's described in our documentation. Don't want to much change the behaviour of the tools. GoMetaLinter works on a single files because of the number of linters it has, so it makes sense for it. We can later discuss it again if it's something worth tackling it. |
Alright. Personally I think this is very confusing and unexpected behaviour though. I was very confused when it said there were no errors even though I saw a clear lint error in my buffer... |
Also
Most commands run for the current file/buffer or the package the file belongs to. I'm not sure how many other commands there are that use the current directory? |
I just thought that each command should exactly work the same when you run it inside the terminal in that files' particular directory. Do you think we should change the default behaviors ? |
I did some testing, and this is how the commands that operate on files or package behave:
Unless I've messed up my testing here, |
This seems something worth tackling. Thanks for the research Martin much appreciated. I believe the behavior for |
gopkg
subpkg/file.go
:GoLint
:GoLint
is run against thegopkg
package rather than thesubpkg
package orfile.go
file.I think it should run against either the
subpkg
package orfile.go
file. This is how e.g.:GoMetaLinter
behaves.I can make a PR if you agree that this is how it ought to behave @fatih
The text was updated successfully, but these errors were encountered: