mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
Fix mypy editor integration for changes in syntastic
This commit is contained in:
parent
3c8640f9ad
commit
3fb125dba7
@ -1,14 +1,19 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
files = [x for x in sys.argv[1:] if not x.startswith('-')]
|
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:
|
if not files:
|
||||||
raise SystemExit(subprocess.Popen(['mypy'] + sys.argv[1:]).wait())
|
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
|
output = subprocess.run('dmypy run -- --follow-imports=error --show-column-numbers --no-color-output'.split(), stdout=subprocess.PIPE).stdout
|
||||||
q = files[0] + ':'
|
q = files[0] + ':'
|
||||||
|
rc = 0
|
||||||
for line in output.decode('utf-8').splitlines():
|
for line in output.decode('utf-8').splitlines():
|
||||||
if line.startswith(q):
|
if line.startswith(q):
|
||||||
print(line)
|
print(line)
|
||||||
|
rc = 1
|
||||||
|
raise SystemExit(rc)
|
||||||
|
Loading…
Reference in New Issue
Block a user