This repository was archived by the owner on Aug 12, 2023. It is now read-only.
Replies: 1 comment 2 replies
-
|
It's strange, the results indicate that the source is generating diagnostics for a temporary file in addition to the actual file, but I don't see anything in the source definition that would lead to that happening. What happens when you run the CLI from the command line using the same arguments as null-ls? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
null_ls.builtins.diagnostics.saltlintas a source<leader>doto run<cmd>lua vim.diagnostic.open_float()<CR>. I only mention this because it's the only other change I've made to the mininal init.lua, beside defining the leader key.Details
[cstevens@neovim] ~/.config/nvim % cat ~/.cache/nvim/null-ls.log [TRACE Thu May 18 21:00:09 2023] ...te/pack/packer/start/null-ls.nvim/lua/null-ls/client.lua:97: starting null-ls client [TRACE Thu May 18 21:00:09 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:102: received LSP request for method initialize [DEBUG Thu May 18 21:00:09 2023] ...te/pack/packer/start/null-ls.nvim/lua/null-ls/client.lua:152: unable to notify client for method textDocument/didOpen (client not active): { textDocument = { uri = "file:///home/cstevens/.config/nvim/files.sls" } } [TRACE Thu May 18 21:00:09 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method initialized [TRACE Thu May 18 21:00:09 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method textDocument/didOpen [TRACE Thu May 18 21:00:09 2023] ...ack/packer/start/null-ls.nvim/lua/null-ls/generators.lua:21: running generators for method NULL_LS_DIAGNOSTICS_ON_OPEN [DEBUG Thu May 18 21:00:09 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:320: spawning command "salt-lint" at /home/cstevens/.config/nvim with args { "--nocolor", "--json", "/home/cstevens/.config/nvim/files.sls" } [TRACE Thu May 18 21:00:09 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:204: error output: [{"id": "207", "message": "File modes should always be encapsulated in quotation marks", "filename": "/home/cstevens/.config/nvim/files.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}, {"id": "210", "message": "Numbers that start with '0' should always be encapsulated in quotation marks", "filename": "/home/cstevens/.config/nvim/files.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}, {"id": "207", "message": "File modes should always be encapsulated in quotation marks", "filename": "/tmp/tmp3b4mzev4.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}, {"id": "210", "message": "Numbers that start with '0' should always be encapsulated in quotation marks", "filename": "/tmp/tmp3b4mzev4.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}][TRACE Thu May 18 21:00:09 2023] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:205: output: nil
[TRACE Thu May 18 21:00:09 2023] ...ck/packer/start/null-ls.nvim/lua/null-ls/diagnostics.lua:181: received diagnostics from source 1
[TRACE Thu May 18 21:00:09 2023] ...ck/packer/start/null-ls.nvim/lua/null-ls/diagnostics.lua:182: { {
code = "207",
col = 0,
end_col = 0,
end_lnum = 9,
lnum = 8,
message = "File modes should always be encapsulated in quotation marks",
row = 9,
severity = 1,
source = "saltlint"
}, {
code = "210",
col = 0,
end_col = 0,
end_lnum = 9,
lnum = 8,
message = "Numbers that start with '0' should always be encapsulated in quotation marks",
row = 9,
severity = 1,
source = "saltlint"
}, {
code = "207",
col = 0,
end_col = 0,
end_lnum = 9,
lnum = 8,
message = "File modes should always be encapsulated in quotation marks",
row = 9,
severity = 1,
source = "saltlint"
}, {
code = "210",
col = 0,
end_col = 0,
end_lnum = 9,
lnum = 8,
message = "Numbers that start with '0' should always be encapsulated in quotation marks",
row = 9,
severity = 1,
source = "saltlint"
} }
[TRACE Thu May 18 21:00:12 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:102: received LSP request for method shutdown
[TRACE Thu May 18 21:00:12 2023] .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:127: received LSP notification for method exit
Details
[cstevens@neovim] ~/.config/nvim % salt-lint --nocolor --json files.sls [{"id": "207", "message": "File modes should always be encapsulated in quotation marks", "filename": "files.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}, {"id": "210", "message": "Numbers that start with '0' should always be encapsulated in quotation marks", "filename": "files.sls", "linenumber": 9, "line": " - mode: 0440", "severity": "HIGH"}]So I'm not sure why null-ls is doubling up and interpreting these 2 errors as 4, repeating the errors twice. I've tried mucking around in saltlint.lua, toggling things like from_stderr, format... and nothing seems to be working for me. I've verified the output is going to stdout (
> /dev/nullmakes stdout go away). I'll admit, I'm not a great coder, and am fairly new to lua, and I know this isn't the end of the world, but it's driving my OCD crazy!0.10.0~ubuntu1+git202305112018-e124672ce-9b397864c-d031e37dc~ubuntu22.04.1from the neovim ppa, but I also have the same problem withNVIM v0.9.0 Build type: Releaseon ArchDetails
[cstevens@neovim] ~/.config/nvim % cat files.sls # vim: ft=slsubuntu-etc-sudoers:
file.managed:
- name: /etc/sudoers
- source: salt://ubuntu/sources/sudoers
- user: root
- group: root
- mode: 0440
- template: jinja
0440should be surrounded by quotes, which is fine; if I do that, the errors go away as they should. So things are definitely working... mostly :)Is this a bug I'm running into, or am I doing something wrong?
Thanks for taking the time to read this. Please let me know if there's anything else I can add to help troubleshoot the issue.
Beta Was this translation helpful? Give feedback.
All reactions