summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/nvim-lint.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/editor/nvim-lint.fnl')
-rw-r--r--fnl/plugins/editor/nvim-lint.fnl26
1 files changed, 26 insertions, 0 deletions
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]}