Last active
April 16, 2017 16:06
-
-
Save ph87/a6dd619c0be8433fc8a0aae445c3f40d to your computer and use it in GitHub Desktop.
保存 python 文件时执行测试
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufWritePost *.py exec ":call PyFlakeTest()" | |
function! PyFlakeTest() | |
silent exec "!flake8 % > /dev/null" | |
if v:shell_error | |
echohl ErrorMsg | |
echomsg "不好!有毛病!" | |
exec "!flake8 %" | |
echohl None | |
endif | |
endfunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment