On Tue, Feb 22, 2022 at 8:50 AM Andreas Schneider asn@redhat.com wrote:
Hi,
I'm a big fan of neovim (emacs users jump to 'emacs:' ;-). neovim has support for the Language Server Protocol and there is a nice plugin called 'null-ls' [1] which allows you to hook linters and formatters into neovim.
I've added support for rpmspec in 'null-ls' so you can get feedback directly while editing a spec file. See the attached screenshot.
How to configure it:
local ok, null_ls = pcall(require, 'null-ls') if not ok then return end local sources = {} if vim.fn.executable('rpmspec') == 1 then table.insert(sources, null_ls.builtins.diagnostics.rpmspec) end null_ls.setup({ debug = false, sources = sources, })
What is currently missing in rpmspec is support to parse the input form stdin instead of a file [2]. But there is already a PR to support it [3].
`rpmspec -P /dev/stdin` seems to work already now. I use this "trick" all the time with programs that don't support stdin/stdout natively. (Sometimes even that doesn't work, e.g. if the program tries to seek or mmap it, but often it does.)
Best regards
Andreas
[1] https://github.com/jose-elias-alvarez/null-ls.nvim/ [2] https://github.com/rpm-software-management/rpm/issues/1926 [3] https://github.com/rpm-software-management/rpm/pull/1928
<snip>