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

.luacheckrc file is ignored with defold linting (lua language server asset) #8861

Closed
hippocoder opened this issue Apr 27, 2024 · 6 comments
Closed
Assignees
Labels
bug Something is not working as expected editor Issues related to the Defold editor lsp Issues related to the Language Server Protocol

Comments

@hippocoder
Copy link

Expected behaviour

Added .luacheckrc with unused_args = false in project root
and expected it to ignore function arguments that are unused

Actual behaviour

ignored file

Steps to reproduce

as above. To work around, I rename all variables unused to _


Build time2024-04-25T16:28:41.309201
Defold channeleditor-alpha
Defold editor sha6ff357f
Defold engine shafd3b8c6
Defold version1.8.0
GPUNVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2
GPU Driver4.6.0 NVIDIA 552.22
Java version17.0.5+8
OS archamd64
OS nameWindows 11
OS version10.0
@britzl britzl added bug Something is not working as expected editor Issues related to the Defold editor lsp Issues related to the Language Server Protocol labels Apr 29, 2024
@britzl
Copy link
Contributor

britzl commented May 15, 2024

This is working for me on macOS at least. Remember that if you make a change to the .luacheckrc file you also need to make a change in the linted file before the code editor updates.

@vlaaad
Copy link
Contributor

vlaaad commented May 15, 2024

In my experience it does not work on Windows, but works on mac

@britzl
Copy link
Contributor

britzl commented May 15, 2024

In my experience it does not work on Windows, but works on mac

Do we know why? Because it is a . file?

@vlaaad
Copy link
Contributor

vlaaad commented May 15, 2024

Don't know... Maybe somehow related to this line here https://github.com/defold/lua-language-server/blob/fc0b6da79648013f5cd88ac01fcf44f1e1d78358/script/core/diagnostics/luacheck.lua#L36 ? Could be something about \ and /...

@britzl
Copy link
Contributor

britzl commented May 15, 2024

Ok, could we perhaps print the rootUri and path to see what they resolve to? I suppose such prints will end up in stdout?

        local rootUri = (workspace.rootUri or ""):gsub("file://", "")
        local path = fs.join(rootUri, ".luacheckrc")
        print(rootUri, path)

@vlaaad
Copy link
Contributor

vlaaad commented May 15, 2024

Fixed in the latest editor

@vlaaad vlaaad closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor lsp Issues related to the Language Server Protocol
Projects
Status: Done
Development

No branches or pull requests

3 participants