mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-10-03 17:47:49 +03:00
Switch to LSP for mypy
This commit is contained in:
parent
4b282211de
commit
c9f8596357
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
# Imports {{{
|
||||
import atexit
|
||||
import base64
|
||||
import json
|
||||
@ -154,6 +155,7 @@
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .rc.base import ResponseType
|
||||
# }}}
|
||||
|
||||
RCResponse = Union[Dict[str, Any], None, AsyncResponse]
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
base = os.path.dirname(os.path.abspath(__file__))
|
||||
files = [os.path.relpath(x, base) for x in sys.argv[1:] if not x.startswith('-')]
|
||||
if not files:
|
||||
raise SystemExit(subprocess.Popen(['mypy'] + sys.argv[1:]).wait())
|
||||
|
||||
output = subprocess.run('dmypy run -- --follow-imports=error --show-column-numbers --no-color-output'.split(), stdout=subprocess.PIPE).stdout
|
||||
q = files[0] + ':'
|
||||
rc = 0
|
||||
for line in output.decode('utf-8').splitlines():
|
||||
if line.startswith(q):
|
||||
print(line)
|
||||
rc = 1
|
||||
raise SystemExit(rc)
|
@ -16,6 +16,11 @@ disallow_incomplete_defs = true
|
||||
strict = true
|
||||
no_implicit_reexport = true
|
||||
|
||||
[tool.pylsp-mypy]
|
||||
enabled = true
|
||||
dmypy = true
|
||||
report_progress = true
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 160
|
||||
target-version = 'py38'
|
||||
|
10
session.vim
10
session.vim
@ -1,15 +1,5 @@
|
||||
" Scan the following dirs recursively for tags
|
||||
let g:project_tags_dirs = ['kitty', 'kittens', 'tools']
|
||||
if exists('g:ale_linters')
|
||||
let g:ale_linters['python'] = ['mypy', 'ruff']
|
||||
else
|
||||
let g:ale_linters = {'python': ['mypy', 'ruff']}
|
||||
endif
|
||||
let g:ale_python_mypy_executable = './mypy-editor-integration'
|
||||
let g:ale_fixers = {
|
||||
\ "python": ["ruff"],
|
||||
\}
|
||||
autocmd FileType python noremap \i :ALEFix<CR>
|
||||
set wildignore+==template.py
|
||||
set wildignore+=tags
|
||||
set expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user