EmacsWiki, among other sources, gives this sort of recipe to add Python checking to Flymake:
(defun flymake-pylint-init ()
(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 "epylint" (list local-file)))
Why is the use of local-file
as a relative filename useful or desirable? I instead use:
(defun flymake-flake8-init ()
(unless (file-remote-p default-directory)
(let ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-with-folder-structure)))
`("flake8" ("--max-complexity=10" ,temp-file)))))
It seems to work fine with the absolute temp-file
.