Goz3rr / vscode-glualint

glualint for vscode
https://marketplace.visualstudio.com/items?itemName=goz3rr.vscode-glualint
MIT License
7 stars 4 forks source link

Linting in VS Code Git diff window not following glualint.json settings #8

Closed Malivil closed 2 years ago

Malivil commented 2 years ago

Hi,

I'm using your extension while working on some GMod addons and I'm really liking it One thing I've noticed, though, is that when I look at the diff between files using the standard Git diff window on the Source Control tab, it doesn't appear to follow the glualint.json settings

For example, I open a file to edit it and there are no warnings. I then look at the diff on the Source Control tab before committing and it shows a bunch of warnings for things I have disabled in my glualint.json

Let me know if you need more information from me =) Thanks in advance

Goz3rr commented 2 years ago

Hey!

If I'm understanding right, you have some code like this:

function foo(a)
    print(a+1)
end

function bar()
    print(self)
end

Which would normally result in two warnings with the default config, but a glualint.json in the same folder to disable some:

{
    "lint_whitespaceStyle": false
}

With this example it seems to work fine for me, both in the regular editor: image

and the diff: image

Do you have some other example I can reproduce it with?

I noticed one small oversight in the code where it would not correctly set the working directory, but this shouldn't cause a difference between text mode and git mode.

I'm not sure what exactly could be going wrong, as my extension basically doesn't handle the configuration part at all. This is all handled by glualint itself, as documented here. It will try to find a glualint.json in the current folder of your project, all the way to the root of the drive. If none is found there it will try for a .glualint.json in your home folder. I could add support for the --config parameter as well but that's not really related either.

Malivil commented 2 years ago

Hi!

Thanks for getting back to me. I got a a couple screenshots to show what's happening on my side and it might only be happening on the "old" side of the diff which wouldn't happen in your example.

Here's what it looks like in the live file: Live

Versus what it looks like in the diff: Diff

You can see on left of the diff there are sections underlined based on a setting I have disabled

Goz3rr commented 2 years ago

Gotcha, I see what you mean now. I managed to reproduce it and just put out version 0.7.0 which should fix your issue.

Malivil commented 2 years ago

I can verify it is fixed.

Thanks a lot for the quick turnaround =)