mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.77k stars 191 forks source link

feat: implement temp file #550

Open FelipeLema opened 4 months ago

FelipeLema commented 4 months ago

fixes #235

FelipeLema commented 4 months ago

missing tests

FelipeLema commented 4 months ago

PR ready, although I'm unsure why 0.6.1 is failing

FelipeLema commented 4 months ago

~oh, so nvim_create_autocmd did not exist ... not sure if it's worth re-doing using vimscript, since it's a (lua / luv) timer object that needs to be handled in there~

implemented using module variable

dante0624 commented 3 weeks ago

@FelipeLema I'm new to this plugin and don't fully understand it, but right now it looks like your changes are unused. Before merging this, wouldn't some type of modification be needed to the init.lua file's M.lint function? It would need to call your temp_filepath function, actually create the temp file, fill it with the contents of the current buffer, and then append the filename to the args table (in M.lint)?

Also, the creation of the temp file and filling it with the contents of the current buffer could all happen within your temp_file.lua file. Maybe a new function or two could be created for that.

I would be happy to work on this with you by the way. Let me know what you think

FelipeLema commented 2 weeks ago

hey @dante0624

the scope of this PR is within https://github.com/mfussenegger/nvim-lint/issues/235 and is meant to provide a tool for shadow files when needed. it is not my intention to replace default implementation of this plugin, but rather extend it to cover previously ignored usecases

filling the tempfile could be done in different ways. I explicitly left that out to keep this PR short