Skip to content

Instantly share code, notes, and snippets.

@RyanKung
Last active July 5, 2016 11:52
Show Gist options
  • Select an option

  • Save RyanKung/f9bf9f2459694adfce1be7064febd97d to your computer and use it in GitHub Desktop.

Select an option

Save RyanKung/f9bf9f2459694adfce1be7064febd97d to your computer and use it in GitHub Desktop.
mypy backend plugin for flymake, do play with mypy !!
;;; mypy.el --- mypy plugin for flymake
;;; Commentary:
;;; Code:
(require 'flymake)
(defun flymake-mypy-init ()
"Init mypy."
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "mypy" (list local-file "-s"))))
(when (load "flymake" t)
(add-to-list 'flymake-allowed-file-name-masks '("\\.py\\'" flymake-mypy-init))
)
(provide 'mypy)
;;; mypy.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment