aboutsummaryrefslogtreecommitdiff
path: root/runtime/compiler/mypy.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-09 08:43:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-11-09 08:43:50 +0800
commitb4c5e743ac66bd288017d769e06751cf9cda9a18 (patch)
tree4f4dcdf54ccd9cd6830455c04381728bf90f830e /runtime/compiler/mypy.vim
parent5c600370e0c0980caffebc1c6563da2d750ff34a (diff)
downloadrneovim-b4c5e743ac66bd288017d769e06751cf9cda9a18.tar.gz
rneovim-b4c5e743ac66bd288017d769e06751cf9cda9a18.tar.bz2
rneovim-b4c5e743ac66bd288017d769e06751cf9cda9a18.zip
vim-patch:6d9a145: runtime(compiler): add mypy and ruff compiler; update pylint linter
mypy and ruff come from https://github.com/Konfekt/vim-compilers/tree/master/compiler and the former was added by @pbnj-dragon closes: vim/vim#16007 https://github.com/vim/vim/commit/6d9a145d719857fe461d045adf3b61ec4b4bb53f Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Diffstat (limited to 'runtime/compiler/mypy.vim')
-rw-r--r--runtime/compiler/mypy.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/compiler/mypy.vim b/runtime/compiler/mypy.vim
new file mode 100644
index 0000000000..891488626a
--- /dev/null
+++ b/runtime/compiler/mypy.vim
@@ -0,0 +1,19 @@
+" Vim compiler file
+" Compiler: Mypy (Python static checker)
+" Maintainer: @Konfekt
+" Last Change: 2024 Nov 07
+
+if exists("current_compiler") | finish | endif
+let current_compiler = "mypy"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" CompilerSet makeprg=mypy
+let &l:makeprg = 'mypy --show-column-numbers '
+ \ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports'))
+exe 'CompilerSet makeprg='..escape(&l:makeprg, ' "')
+CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save