remove lint, just use efm
change
commit cb106c186fd59b00d103d43662b80ec679eef3db
author Alpha Chen <alpha@kejadlen.dev>
date
parent 12667ea2
diff --git a/.gitmodules b/.gitmodules
index 28686262..979a7325 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -174,9 +174,6 @@
 [submodule ".local/share/nvim/site/pack/kejadlen/start/tabular"]
 	path = .local/share/nvim/site/pack/kejadlen/start/tabular
 	url = https://github.com/godlygeek/tabular.git
-[submodule ".local/share/nvim/site/pack/kejadlen/start/lint"]
-	path = .local/share/nvim/site/pack/kejadlen/start/lint
-	url = https://github.com/mfussenegger/nvim-lint.git
 [submodule ".local/share/nvim/site/pack/kejadlen/start/treesitter"]
 	path = .local/share/nvim/site/pack/kejadlen/start/treesitter
 	url = https://github.com/nvim-treesitter/nvim-treesitter.git
diff --git a/.local/share/nvim/site/pack/kejadlen/start/lint b/.local/share/nvim/site/pack/kejadlen/start/lint
deleted file mode 160000
index 5249977a..00000000
--- a/.local/share/nvim/site/pack/kejadlen/start/lint
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 5249977a585c3c17d94afdc8f0255a689d3a0057
diff --git a/nvim/fnl/ale.fnl b/nvim/fnl/ale.fnl
index 524f6075..f9bc85ae 100644
--- a/nvim/fnl/ale.fnl
+++ b/nvim/fnl/ale.fnl
@@ -1,9 +1,11 @@
 (set vim.g.omnifunc "ale#completion#OmniFunc")
 (set vim.g.ale_fix_on_save 1)
 (set vim.g.ale_floating_preview 1)
-(set vim.g.ale_floating_window_border [:│ :─ :╭ :╮ :╯ :╰ :│ :─])
+(set vim.g.ale_floating_window_border
+     ["│" "─" "╭" "╮" "╯" "╰" "│" "─"])
 (vim.keymap.set :n :gd "<Plug>(ale_go_to_definition)" {:noremap true})
 (vim.keymap.set :n :gr "<Plug>(ale_find_references)" {:noremap true})
 (vim.keymap.set :n :K "<Plug>(ale_hover)" {:noremap true})
 (vim.keymap.set :n :<C-k> "<Plug>(ale_previous_wrap)" {:silent true})
 (vim.keymap.set :n :<C-j> "<Plug>(ale_next_wrap)" {:silent true})
+
diff --git a/nvim/fnl/init.fnl b/nvim/fnl/init.fnl
index e54af730..b6ec0045 100644
--- a/nvim/fnl/init.fnl
+++ b/nvim/fnl/init.fnl
@@ -87,16 +87,6 @@
     (tset palette f :middle [[:NONE :NONE :NONE :NONE]]))
   (tset vim.g palette-key palette))
 
-;;; lint
-
-(let [lint (require :lint)
-      {: linters :linters_by_ft linters-by-ft :try_lint try-lint} lint
-      {:fennel fennel-linter} linters
-      {: nvim_create_autocmd} vim.api]
-  (tset linters-by-ft :fennel [:fennel])
-  (tset fennel-linter :globals [:vim :hs :spoon]) ; hack for neovim and hammerspoon
-  (nvim_create_autocmd :BufWritePost {:callback #(try-lint)}))
-
 ;;; lspconfig
 
 ;; (vim.lsp.set_log_level :debug)
@@ -133,18 +123,31 @@
     (vim.keymap.set :n :gr vim.lsp.buf.references bufopts)
     (vim.keymap.set :n :<leader>lf vim.lsp.buf.formatting bufopts)))
 
-(let [{: efm : rust_analyzer : tsserver} (require :lspconfig)]
+(let [{: efm : rust_analyzer : tsserver} (require :lspconfig)
+      fmt (fn [formatCommand formatStdin]
+            {: formatCommand : formatStdin})
+      lint (fn [lintCommand lintFormats lintStdin]
+             {: lintCommand : lintFormats : lintStdin})
+      prettier (fmt "prettier --stdin-filepath ${INPUT}" true)
+      ;; https://github.com/alexaandru/nvim-config/blob/master/fnl/config/efm.fnl
+      fennelFmt (fmt "fnlfmt /dev/stdin" true)
+      fennelLint (lint "fennel --globals vim,hs,spoon --raw-errors $(realpath --relative-to . ${INPUT}) 2>&1"
+                       ["%f:%l: %m"] true)
+      fennel [fennelFmt fennelLint]]
   ((. efm :setup) {:on_attach on-attach
                    :init_options {:documentFormatting true
                                   :hover true
                                   :documentSymbol true
                                   :codeAction true
                                   :completion true}
-                   :settings {:languages {:javascript [{:formatCommand "prettier --stdin-filepath ${INPUT}"
-                                                        :formatStdin true}]
-                                          :typescript [{:formatCommand "prettier --stdin-filepath ${INPUT}"
-                                                        :formatStdin true}]}}
-                   :filetypes [:javascript :typescript]})
+                   :settings {:languages {:javascript [prettier]
+                                          :typescript [prettier]
+                                          :typescriptreact [prettier]
+                                          : fennel}}
+                   :filetypes [:javascript
+                               :typescript
+                               :typescriptreact
+                               :fennel]})
   ((. rust_analyzer :setup) {:on_attach on-attach
                              :settings {:rust-analyzer {:checkOnSave {:command :clippy}}}})
   ((. tsserver :setup) {:on_attach (fn [client bufnr]
@@ -183,3 +186,4 @@
 ;; Load all of the helptags now, after plugins have been loaded.
 ;; All messages and errors will be ignored.
 (vim.api.nvim_command "silent! helptags ALL")
+