Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created April 15, 2012 04:15
Show Gist options
  • Save laclefyoshi/2389979 to your computer and use it in GitHub Desktop.
Save laclefyoshi/2389979 to your computer and use it in GitHub Desktop.
using checkstyle with flymake
;; flymake + checkstyle
(require 'flymake-cursor)
(add-hook 'java-mode-hook
'(lambda ()
(flymake-mode t)))
(when (load "flymake" t)
(defun flymake-java-checkstyle-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 "/opt/bin/checkstyle.sh" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.java\\'" flymake-java-checkstyle-init)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment