summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/nvim-lint.fnl
blob: bcec08b1aca99ae222a17053c3d72e2f891bbe4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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]}