From b96571d104ab72d95c41ffc120afa260dd280934 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 4 Dec 2023 22:20:46 +0100 Subject: Replace null(none)-ls with conform and nvim-lint --- fnl/plugins/editor/nvim-lint.fnl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fnl/plugins/editor/nvim-lint.fnl (limited to 'fnl/plugins/editor/nvim-lint.fnl') diff --git a/fnl/plugins/editor/nvim-lint.fnl b/fnl/plugins/editor/nvim-lint.fnl new file mode 100644 index 0000000..bcec08b --- /dev/null +++ b/fnl/plugins/editor/nvim-lint.fnl @@ -0,0 +1,26 @@ +;; Linting + +(fn init [] + (let [lint-augroup (vim.api.nvim_create_augroup :lint {:clear true}) + lint (require :lint)] + (vim.api.nvim_create_autocmd [:BufEnter :BufWritePost :InsertLeave] + {:group lint-augroup + :callback (lambda [] + (lint.try_lint))}))) + +(fn config [] + (let [lint (require :lint)] + (set lint.linters_by_ft {:zsh [:zsh] + :* [:codespell :write_good] + :fennel [:fennel] + :yaml [:yamllint] + :python [:ruff] + :lua [:selene] + :commit [:commitlint] + :docker [:hadolint] + :haskell [:hlint] + :json [:jsonlint] + :sh [:shellcheck] + :sql [:sqlfluff]}))) + +{1 :mfussenegger/nvim-lint : init : config :event [:BufReadPost :BufNewFile]} -- cgit v1.2.3-70-g09d2