Created
April 15, 2012 04:15
-
-
Save laclefyoshi/2389979 to your computer and use it in GitHub Desktop.
using checkstyle with flymake
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
;; 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