diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-01-11 00:48:06 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-01-11 00:48:06 +0100 |
| commit | 16810b083ae6589a26ee0d0b60563447a92fc588 (patch) | |
| tree | 3c9adaaecd2aa1e3865bd78dd584760e00fa611d /flycheck-android-experimental.el | |
| parent | f933d0d3efcd441eecde54bcd5891c1d8cac1eec (diff) | |
Add support for running checkstyle after compilation
Diffstat (limited to 'flycheck-android-experimental.el')
| -rw-r--r-- | flycheck-android-experimental.el | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/flycheck-android-experimental.el b/flycheck-android-experimental.el index 181b056..e041e76 100644 --- a/flycheck-android-experimental.el +++ b/flycheck-android-experimental.el @@ -14,10 +14,38 @@ (defvar flycheck-android-sessiondir nil "Session directory used for caching.") +(flycheck-def-option-var flycheck-android-java-checkstyle-jar nil android-java + "Path to checkstyle-VERSION-all.jar." + :safe #'stringp) +(make-variable-buffer-local 'flycheck-android-java-checkstyle-jar) + +(flycheck-def-option-var flycheck-android-java-checkstyle-path nil android-java + "Path to use as workdir and base for config and properties." + :safe #'stringp) +(make-variable-buffer-local 'flycheck-android-java-checkstyle-path) + +(flycheck-def-option-var flycheck-android-java-checkstyle-config nil android-java + "Path to checkstyle-config.xml if one should be used." + :safe #'stringp) +(make-variable-buffer-local 'flycheck-android-java-checkstyle-config) + +(flycheck-def-option-var flycheck-android-java-checkstyle-properties nil android-java + "Path to checkstyle.properties if one should be used." + :safe #'stringp) +(make-variable-buffer-local 'flycheck-android-java-checkstyle-properties) + (flycheck-define-checker android-java "Java syntax checker using javac." :command ("python" (eval (flycheck-android-find-tool "java")) + (option "--checkstyle-jar=" + flycheck-android-java-checkstyle-jar concat) + (option "--checkstyle-path=" + flycheck-android-java-checkstyle-path concat) + (option "--checkstyle-config=" + flycheck-android-java-checkstyle-config concat) + (option "--checkstyle-properties=" + flycheck-android-java-checkstyle-properties concat) (eval (flycheck-android-get-sessiondir)) (eval buffer-file-name) source) @@ -29,7 +57,10 @@ (error line-start (file-name) ":" line ": error:" (message (one-or-more (not (any "^"))) (any "^")) - line-end)) + line-end) + ;; checkstyle messages + (warning line-start (file-name) ":" line ": warning: " (message) line-end) + (error line-start (file-name) ":" line ": " (message) line-end)) :modes java-mode) (defun flycheck-android-find-tool (tool) |
